fgetc -- Read a Character

Format

#include <stdio.h>
int fgetc(FILE *stream);

Language Level: ANSI, POSIX, XPG4
fgetc reads a single unsigned character from the input stream at the current position and increases the associated file pointer, if any, so that it points to the next character.

Note: fgetc is identical to getc but is always implemented as a function call; it is never replaced by a macro.

Return Value
fgetc returns the character read as an integer. An EOF return value indicates an error or an end-of-file condition. Use feof or ferror to determine whether the EOF value indicates an error or the end of the file.

Example



_fgetchar -- Read Single Character from stdin
feof -- Test End-of-File Indicator
ferror -- Test for Read/Write Errors
fputc -- Write Character
getc -- Read a Character
_getch -_getche -- Read Character from Keyboard
<stdio.h>