Included in the conio.h
library for 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.