C feof

C feof function is used to determine if the end of the file (stream), specified has been reached or not. This function keeps on searching the end of file (eof) in your file program.

Syntax:
int feof(FILE *stream)
Example:
while (!feof(fileName)) {
    printf("%s", strr);
    fgets(st, 50, fileName);
}
fclose(fileName)
  • C feof function returns true in case end of file is reached, otherwise it's return false.