Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - feof http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   feof

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

   Description
   feof determines if the stream fp is at the end of file. After the  EOF
   indicator is set no further read operations are allowed.

   Example
   #include <stdio.h>
   #define BUFSIZE 128
   char buffer[BUFSIZE];
   main()
   {
   FILE *fp;
        fp = fopen ("file.dat", "r");

        while ( !feof(fp) )
             fgets(buffer, BUFSIZE, fp);

        printf("Done reading file, EOF found\n",buffer);
   }

   Return Value
   Non-zero (EOF flag set) if current position is end. No read operations
   are  allowed  after the flag is set. The flag is  cleared  if  rewind,
   fseek or file is closed. 0 if the flag is clear.


See Also: clearerr ferror

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson