feof


feof

Tests whether the file position is at the end

 #include <stdio.h> int feof ( FILE *fp  ); 

The feof( ) macro tests whether the file position indicator of a given file is at the end of the file.

The feof( ) macro's argument is a FILE pointer. One attribute of the file or stream referenced by this pointer is the end-of-file flag, which indicates that the program has attempted to read past the end of the file. The feof( ) macro tests the end-of-file flag and returns a nonzero value if the flag is set. If not, feof( ) returns 0.

Example

See the examples at clearerr( ) and fclose( ) in this chapter.

See Also

rewind( ), fseek( ), clearerr( ), ferror( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net