C – Getc

C – Getc 2017-07-20T09:25:24+00:00

getc()

Declaration:

int getc(FILE *stream);

The getc() function returns the next character from the specified input stream and increment file position indicator. The character is read as an unsigned char that is converted to an integer.

If the end-of-file is reached, getc() returns EOF. If getc() encounters an error, EOF is also returned. The function getc() and fgetc() are identical.

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

C – GETC() EXAMPLE PROGRAM :

Prev Next