C – Fgetc

C – Fgetc 2017-06-12T13:10:17+00:00


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.

Prev Next