Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-39
feof
feof
The feof function checks whether the file-position indicator of a file opened for
ANSI I/O is at the end of the file.
stream
denotes a file opened for ANSI I/O.
Return Value
is nonzero if the file-position indicator is at the end of the file; otherwise, feof
returns a zero.
Usage Guidelines
The feof function might be implemented as a macro in a future release.
Example
This example checks the end-of-file indicator for the file $a.b.c:
#include <stdioh>
FILE *fp;
fp = fopen("$a.b.c", "r");
/* ... */
if(feof(fp)) printf("End of file has been reached.");
#include <stdioh>
int feof(FILE *stream);