Stop large loop in run time?
-
how do i stop a time consuming for loop in run time? (apart from using callbacks/multithreading) is there a brutal way to stop a loop like: for (int i=0; i<=10000000000000; i++) { j += i; } ideas ??? :confused:
Something like this?: http://www.cpp-home.com/contests/tests.php[^] Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT) -
how do i stop a time consuming for loop in run time? (apart from using callbacks/multithreading) is there a brutal way to stop a loop like: for (int i=0; i<=10000000000000; i++) { j += i; } ideas ??? :confused:
make it like this:
for (int i=0; i<=10000000000000; i++) {
j += i;
if( bStop )
break;
}
...
void Stop()
{
bStop = TRUE;
}AND: i is an integer number, so 10000000000000 IS INVALID for int!!! (too big) Don't try it, just do it! ;-)