FILE HANDLING USING getline() FUNCTION IN C++

#include
#include
#include
Int main()
{
Char inputline[80],outputline[80];
Ofstream entryfile(“fewlines.dat”);
While(true)
{
Cin.getline(inputline,80);
If(!strcmp(inputline,”end”))
Break;
Entryfile<<
}
Entryfile.close();
Ifstream displayfile(“fewlines.dat”);
While(!displayfile.eof())
{
Displayfile.getline(outputline,80);
Cout<<
}
Displayfile.close();
Return 0;
}


Input:
It was a fight
 for pride
output:
it was a fight for pride

Post a Comment

Post Your comments,Views and thoughts Here, Give Us Time To Respond Your Queries