#include <string>
#include <iostream>
using namespace std;
int main()
{
cout << "HELLO ";
sleep(2000);
cout << "WORLD\n\n";
system("pause");
return 0;
}
SLEEEP! [FIXED]
Hello, I was looking up on "sleep". I wanted to make a delayed message, but when I use sleep, it says theres an error. Please help me.
Could you be more specific? Is it a compiler error? Is it a runtime error? What does the error say?
Sleep() is a Win32 API function. Thus, all you gotta do is include windows.h too like this...
#include <windows.h>
#include <windows.h>
it isn't sleep(2000) it is Sleep(2000)... and be sure to include windows.h like nullsmind said.
Sleep is a non-standard Windows-only function. sleep is a bit more portable. sleep is in <unistd.h>.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement