C – Fgetc

C – Fgetc 2017-08-07T14:29:54+00:00

fgetc()

Declaration:

int fgetc(FILE *stream);

The fgetc() function returns the next character from the specified input stream and increments the file position indicator. The character is read as an unsigned char that is converted to an integer. If the end-of-file is reached, fgetc() returns EOF. If fgetc() encounters an error, EOF is also returned.

For example, the following program reads and displays the content of text file.

C – FGETC() EXAMPLE PROGRAM :

Prev Next