Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Printing the last item of a structure twice
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jerry Coffin, post: 3910499"] [ ... ] Your problem is right here. The problem is that eof on a stream isn't detected until AFTER you attempt a read and you're at the end of the end of the file, and the attempted read fails. When the read fails at the end of the file, what was previously read will still be there, but you won't have detected the end of the file yet, so you'll process it again. Then the code above will detect that the previous read failed and quit trying to read any more. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Printing the last item of a structure twice
Top