Included in the conio.h library for C/C++.

Prototype:
int _getch(void);

Description:
This function receives character data from stdin. Accessing the console directly, it will wait until a key is pressed on the keyboard, and then return the data immediately, without buffering until a carriage return is entered. The character is not echoed to stdout.

Because _getch() bypasses the normal buffering procedures used by getchar() and getc(), ungetc() cannot be used with _getch(). A specialized function _ungetch() was created in its stead for this purpose.

Returns:
Returns the next character read. Never returns an error code.

Log in or register to write something here or to contact authors.