I'm currently using fgetc()
in loop for reading whole file.
But I need to detect EOF
in two iterations of this loop.
I know that EOF
can't be returned to stream using ungetc()
.
What about using
fseek(file, -1, SEEK_CUR)
Is it safe and portable to get before EOF
using fseek
and read it again?
Thanks.