• C

fseek

does fseek fail(return nozero), if it goes past the end of the file?
jesse.laeuchli@usa.net
LVL 5
laeuchliAsked:
Who is Participating?
 
RONSLOWConnect With a Mentor Commented:
The documentation (in VC) on fseek says:

"You can use fseek to reposition the pointer anywhere in a file. The pointer can also be positioned BEYOND THE END OF THE FILE. fseek clears the end-of-file indicator and negates the effect of any prior ungetc calls against stream."

However, it is not clear what will be written to / read from the file after an fseek past eof.

0
 
seedyCommented:
Seeking pas t end of file will succeed.  So, fseek will not return nonzero to indicate error.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.