hey, if i want a user to press a keyboard key(like "k") anytime during a loop so something will happen in addition to everything else in the loop,
how do i do that?
like
1 2 3 4
for(int a=0; a<100; a++){cout<<"somthing";
//if user press K
//cout<<"more something";
}
but if i do that the program will stop waiting for the user input,
i want that while the program is running the user can anytime press "k" to do somthing.
If you want your program to do more than one task at a time, in this case watch for input and process data in the background, then you need more than one thread: http://www.cplusplus.com/reference/multithreading/