Timed Input
Archived 2 years ago
W
FreeKayD
Is there anyone That is familiar with C++ at the moment i need help with a countdown type program
I already have my code counting down but i want it to stop when the user inputs something into a variable
what i have so far
int seconds=5;
`int user;
while(seconds>0)
{
cout<<"\r0"<< seconds;
fflush(stdout);
clock_t stop = clock() + CLOCKS_PER_SEC;
while(clock()<stop){}
seconds--;
}
cout<<"\rBOOM!";
}`
wanna add the user function somewhere in the loop where it stops it when a value has been passed to it
