feof
feof is a function in the C standard library used to test whether the end-of-file indicator for a given FILE stream has been set. It is declared in stdio.h and has the prototype int feof(FILE *stream). The function returns a nonzero value if the end-of-file indicator for the stream is set, and zero otherwise.
The end-of-file indicator is set by input functions when an attempt to read reaches the end of
Usage and caveats: feof should not be used as the primary loop condition to control input. It
Relation to other status checks: feof complements ferror, which tests for read errors. Together, they help distinguish
Overall, feof provides a way to query whether the end of a stream has already been reached,