SyntaxFix
Write A Post
Hire A Developer
Questions
Without to much modifications of the original code, it could become :
while (!iFile.eof()) { int x; iFile >> x; if (!iFile.eof()) break; cerr << x << endl; }
but I prefer the two other solutions above in general.