kbhit is a C/C++ function used to determine if a key has been pressed or not
Prototype: int kbhit(void);
Header File: conio.h
If a key has been pressed then it returns a non zero value otherwise returns zero.
Declaration : int kbhit();
How to use:
#include <stdio.h>
#include <conio.h>
main()
{
while (!kbhit())
printf("You haven't pressed a key.\n");
return 0;
}