Use the new CRAY supercomputer. It can calculate the infinite loop in 10 minutes!
No, joking. use "break" inside the loop. If you want to cancel from within "gottime", you can use the return value of gottime:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
...
while(true)
{
Sleep(1000);
if (gottime(h,m,s))
break;
}
void gotime(int& h, int& m, int& s)
{
...
if (h == 23 && m == 23 && s == 23)
returntrue; // time of the illuminati! Break immediately!
...
returnfalse;
}