Does anybody know if i can use fgetpos then close+opening a file and use fsetpos with the value from fgetpos?
Does anybody know if i can use fgetpos then close+opening a file and use fsetpos with the value from fgetpos?
Sounds like it should work.
Are you asking before trying it, or have you tried it and it doesn't work?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I ask it because i dont know what fgetpos returns. I get the idea it just returns the positing of the byte. But i cant be shure just by testing it a couple of times. I would really like to get some certainty about this because writing to random locations in files can give some nasty problems .
(*i know that the position isnt returned but is stored in the 2nd param of fgetpos*)
If you understand what you're doing, you're not learning anything.
thanks.. exactly the info i was looking for, at least i believe it is. Maybe a noob question, but at the top i see "Mac OS X / Darwin man pages". Is this info usable for devcpp (mingw)??
At the bottom of that page you should also see:
mingw uses gcc which conforms to the C90 standard, so yes it's usable.The fgetpos(), fsetpos(), fseek(), ftell(), and rewind() functions con-
form to ISO/IEC 9899:1990 (``ISO C90'').
If you understand what you're doing, you're not learning anything.