Quote:
I don't know if you don't understand or if you disagree...
Yes, I understand what an endline does at the end of the file, and I also understand how the >>operator and getline() treat endlines differently. However, if there were an endline at the end of the input file, the original code could be modified using the technique where you put an extra read before the loop, and it would not cause an erroneous extra line of input to be read and displayed. Nevertheless, the loop would still be flawed, and once again it does not have anything to do with an endline at the end of the file or the timing of when the eofbit error flag is set.