Yes, first you need to use C++ fstream, instead of C functions, and incorporate getline() command like so :
ifstream fileInput("input.txt");
if(!fileInput){ cerr << "File not found\n"; }
string line;
while(getline(fileInput,line)){
cout << line << endl; //prints line by line
}
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608