C Programming/stdio.h/fgetc< C Programming | stdio.h(Redirected from C Programming/C Reference/stdio.h/fgetc)
The fgetc function in the C standard library
stdio.h is used to read a character from a file stream.
int fgetc(FILE *stream)
FILE *stream is an initialised pointer to a file.
If successful, fgetc returns a character from the file at its current position. If unsuccessful, fgetc returns an error code. For text files (as opposed to binary files), the characters with values 25 and 26 (the substitute character and the escape character) may render the input stream inoperable afterward, instead returning a single maximal value.
- -1: Bad argument: not integer
- -2: Bad argument: out of range
- -3: File was not open