- test for end-of-file

File Input/Output functions
(AFL 2.5)

SYNTAX feof( filehandle )
FUNCTION The feof function returns a nonzero value after the first read operation that attempts to read past the end of the file. It returns 0 if the current position is not end of file. There is no error return value.

filehandle is a file handle returned by fopen function.

// The following code (commentary) reads
// all lines from the external file and
// displays it in commentary window

fh =
fopen( "quotes.csv", "r");
if( fh )
while( ! feof( fh ) )
printf( fgets( fh ) );   
printf("ERROR: file can not be found (does not exist)");

SEE ALSO fopen() function , fclose() function , fgets() function


The feof function is used in the following formulas in AFL on-line library:

More information:

Updated on-line reference