feof function-check if it is at the end of the file

You can use the feof function to check if the input file stream has reached the end of the file. You can use it by reading the stdio.h header.

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

The argument is a file stream. The return value is a non-zero value if it has reached the end, and 0 if it has reached the end.

Feof function sample

A sample using the feof function can be found in the fgetc function sample.

Associated Information