feof function(Test for End-of-File) in C Language – example and detail

In the C Programming Language, the feof feature checks to see if the end-of-file indicator has been set for a move pointed to by stream.


The syntax for the feof characteristic in the C Language is:

int feof(FILE *stream);

Parameters or Arguments

stream The flow whose end-of-file indicator is to be tested.


The feof feature returns a nonzero fee if the end-of-file indicator is set. Otherwise, it returns zero.

Required Header

In the C Language, the required header for the feof feature is:

#include <stdio.h>

Applies To

In the C Language, the feof function can be used in the following versions:

ANSI/ISO 9899-1990

Similar Functions

Other C features that are similar to the feof function:

ferror function <stdio.h>

See Also

Other C functions that are noteworthy when dealing with the feof function:

clearerr function fseek function rewind characteristic