C Programming Tutorial
In the C Programming Language, the getchar function reads a character from the stdin stream.
Syntax
The syntax for the getchar function in the C Language is:
int getchar(void);
Returns
The getchar function returns the character read. If an error occurs, the getchar function will set the stdin's error indicator and return EOF. If the getchar function encounters the end of stream, it will set the stdin's end-of-file indicator and return EOF.
Required Header
In the C Language, the required header for the getchar function is:
#include <stdio.h>
Applies To
In the C Language, the getchar function can be used in the following versions:
- ANSI/ISO 9899-1990