Hi guys!
How should I do to stop a for statement if ESC key is pressed?
thank you guys!
Hi guys!
How should I do to stop a for statement if ESC key is pressed?
thank you guys!
I use windows and an DOS compiler.. so i would code it like this.... please not this code may not compile on all compilers
Code:# include <conio.h> int main() { char ch=' '; while(ch!=27) { //do something if(kbhit()) ch=getch(); } return 0; }
thank you!