Parameter

stream

Input stream.

Return Value

Returns the character read. To indicate a read error or end-of-file condition, getc and getchar return EOF, and getwc and getwchar return WEOF. For getc and getchar, use ferror or feof to check for an error or for end of file.

Remarks

Each routine reads a single character from a file at the current position and increments the associated file pointer (if defined) to point to the next character. For getc and getwc, the file is associated with stream (see Choosing Between Functions and Macros). Routine-specific remarks follow.

Routine

Remarks

getc

Same as fgetc, but implemented as a function and as a macro.

getwc

Wide-character version of getc. Reads a multibyte character or a wide character according to whether stream is opened in text mode or binary mode.