Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

feof - Test for end of file

&pagelevel(4)&pagelevel

Definition

#include <stdio.h>

int feof(FILE *fp);

feof detects the end of the file pointed to by file pointer fp.

Return val.

!= 0

0

End of file has been reached.

Otherwise.

Notes

feof is implemented both as a macro and as a function (see section “Functions and macros”).

feof is normally used following access functions that do not report end of file (fread).

If the file has been repositioned (e.g. with fseek/fseek64, fsetpos/fsetpos64, rewind)
after EOF has been reached, or if the clearerr function has been called, feof returns a
value of 0.

Record I/O

See also

feof can also be used unchanged on files with record I/O.

clearerr, ferror, fopen, fopen64, fseek, fseek64, fsetpos, fsetpos64