getchar()

Declaration

int getchar();

Description:

This function read a character from the standard input stream, "stdin," returns the read character and advances the stream pointer. If the function is not successful, it returns EOF.

Example

#include <cstdio>

int main()
{
    // Read the first typed in character.
    int iRet = getchar();
    printf("You typed: %c\n", (char)iRet);

    return 0;
}

Output:

getchar() Output