#include #include int notmain() { char c='N'; //N is assigned to c for(;;) //infinite loop { printf("%c\t",c); //N is printed over and over if(_kbhit()) //until a key is hit, the keyvalue is stored in the buffer { c=_getch(); //c is fed the value from the buffer. The program does not pause here printf("%c",c); //print the key break; //break the loop } } _getch(); //yes, the program does pause here. return 0; } int main() { /* Display message until key is pressed. */ while( !_kbhit() ) _cputs( "Hit me!! " ); /* Use _getch to throw key away. */ printf( "\nKey struck was '%c'\n", _getch() ); }