Eg:
cout<<"\n Time used (in seconds) :";
for(int i=0; i<100; i++)
{
cout<< i;
delay(1000);
cout<<"\b";
}
I want to modify the program segment so that while the loop goes on, if user presses any key (during run time), the loop stops. If he does not, the loop continues normally till i=100.
I realize multithreading is the only to do this. Since I am a beginner, I'd like if you tell me how to go about it without using classes. Please give me a program with comments to explain the syntax and logic.