I need to do very long simulation, let's say this:
int i;
vector result;
while(true)
{
i = random(8);
if (i < 4) {result.push_back(i);}
}
cout << result;
Is there a way to stop this while loop from console doing something (e.g. pressing a key) without typing CTRL-C or without introducing a cin or system-pause function? I'd like to let this while loop going on until I decide to stop it!