kbhit()Prototype: int kbhit(void);Header File: conio.h Explanation: This function is not defined as part of the ANSI C/C++ standard. It is generally used by Borland's family of compilers. It returns a non-zero integer if a key is in the keyboard buffer. It will not wait for a key to be pressed. Example:
//Example will loop until a key is pressed
//Example will not work with all compilers
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
while(1)
{
if(kbhit())
{
break;
}
}
}
Other Functions
|