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

int _ungetch(int c);

The _ungetch() function puts the character c back into the keyboard buffer, so that c will be the next character read by _getch() or _getche(). You can call _ungetch() only once before the next read.

If the function successfully places the character back onto the buffer, c is returned. If it fails for whatever reason, EOF is returned.

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