Tests the end-of-file indicator for a stream.
#include <stdio.h> int feof ( FILE *fp);
(IN) Points to the file to be tested.
Returns nonzero if the EOF indicator is set for the stream specified by fp.
Because the EOF indicator is set when an input operation attempts to read past the end of the file, feof detects the end of the file only after an attempt is made to read beyond the end of the file. Thus, if a file contains 10 lines, feof does not detect the end of the file after the tenth line is read; it detects the end of the file once the program attempts to read more data.