I have not been able to find my book...what is the command for key presses again? Like if I press something a action happens
I have not been able to find my book...what is the command for key presses again? Like if I press something a action happens
"getch()"?
I think that's in "conio.h"
Brendan
Draco dormiens nunquam titillandus
Example:
BrendanCode:int main() { int keyPress; cout << "Enter a number between 1 and 3: "; keyPress = getch(); switch (keyPress) { case '1': cout << "You entered one!\n"; break; case '2': cout << "You entered two!\n"; break; case '3': cout << "You entered three!\n"; break; default: cout << "Not a number between 1 and 3!\n"; break; } return 0; }
Draco dormiens nunquam titillandus
Is there a certain resource file for that command harry? Cause it won't work with just i/o stream...Anyone?!?
"conio.h"
Brendan
Draco dormiens nunquam titillandus