int getchar ( void );
Get the next character from stdin.
Returns the next character from the standard input (stdin).
It corresponds to: getc(stdin)
The character read is returned as int. If the End Of File is reached or there has been an error reading, the function returns an EOF character.
EOF can also indicate an error while reading, use ferror() to check if an error has occurred.
Defined in ANSI-C.
/* getchar example : typewriter */
puts ("Enter text. Include a dot ('.') in a sentence to exit:");
} while (c != '.');
A simple typewriter. Every sentence is echoed once ENTER has been
pressed until a dot (.) is included in the text.
getc, putchar, fgetc, fopen