lundi 3 février 2020

Input/Output files in c++

i have got a huge problem with input/output files in c++.. So i can't find program which reads from a file and prints out the largest string in another (out text) file...I can't even start so please any help, some example will be much appreciated.. I have only this one which reads from a file

int main(){
fstream file;
   string word, t, q, filename;

   filename = "file.txt";

   file.open(filename.c_str());
   while(file >> word)
   {
       cout << word << endl;
return 0; 
}

Aucun commentaire:

Enregistrer un commentaire