-
Sleep problem
I use sleep in places in my code but it all goes to begining how can i fix?
code is here
#include <iostream.h>
#include <conio.h>
#include <windows.h>
int main(void) {
int number = 1;
int num_of_miliseconds;
Sleep(num_of_miliseconds);
cout << "Hello kid's.\n";
Sleep(1000);
cout <<"How are you?\n";
Sleep(1000);
cout <<"Thats good.\n"; //this was all just example
}
-
thats awful.......I'm having Sleep problems also. My pillow doesn't feel comfortable.
-
HA HA..... ok but does any1 konw how to fix it?
-
#include <iostream.h>
#include <conio.h>
#include <windows.h>
int main(void) {
int number = 1;
int num_of_miliseconds;
Sleep(num_of_miliseconds);
cout << "Hello kid's.\n";
Sleep(1000);
cout <<"How are you?\n";
Sleep(1000);
cout <<"Thats good.\n"; //this was all just example
}
Ruflano's Makeover
#include <iostream>
#include <windows.h>
int main()
{
int miliseconds=1000;
cout << "Hello Kids\n";
Sleep(miliseconds);
cout << "How are you?\n";
Sleep(miliseconds);
cout << "Thats good.\n"; // bad examples I might ass
Sleep(miliseconds);
return 0;
}
-
int num_of_miliseconds;
Sleep(num_of_miliseconds);
You use a variable that you never defined.
-
yeah, not declaring a variable and then using it for a Sleep function? bad