file io question pretty simple
ok my problem is i have a file with data stored like this:
20 200 2
30 300 3
40 400 4
\n
ok it writes user input to a file and starts a newline after
the last value is entered. now on that last line when i enter the 4 and it starts row 4 i quit the program.
the file has 3 rows plus the start of row 4 but its empty.
when i go to read in the file and display the data it displays the last row of data twice becuase of the \n that was from the 4. how can i end the file output so that there is no new line started after the third row of data is entered?
November 08, 2000 04:21 PM
You''re probably just checking for a feof(), but you need to check the return value of the read function as well.
You didn''t state how you were reading, so I''m guessing
You didn''t state how you were reading, so I''m guessing
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement