fgetc()

This is a File I/O function. It is not implemented in the Compiler.

Syntax
  #include <stdio.h>

  
  int fgetc(FILE *f);

  
Description

fgetc() reads the next character from file f.

Note: If file f had been opened as a text file, the end-of-line character combination is read as one '\n' character.
Return

The character is read as an integer in the range from 0 to 255. If there was a read error, fgetc() returns EOF and sets the file's error flag, so that a subsequent call to ferror() will return a non-zero value. If an attempt is made to read beyond the end of the file, fgetc() also returns EOF, but sets the end-of-file flag instead of the error flag so that feof() will return EOF, but ferror() will return 0.

See also

fgets(),

fopen(),

fread(),

fscanf(), and

getc()