Click to See Complete Forum and Search --> : sleep() URGENT!!!!!!!


chongwei
April 19th, 1999, 09:51 AM
i need help!!! i wan the dots to appear one by one. but i got errors. 'sleep' is not a member of 'global namespace' and 'sleep' is undeclared identifier.
#include <stdio.h>

main()
{
int counter;

for(counter=0;counter<10;counter++)
{
printf(".\n");
sleep(?????);
}

return 0;
}

Markus Grossmann
April 19th, 1999, 10:03 AM
Try
#include <winbase.h>
...
Sleep(1000);


HTH
Markus

bsmanoj
April 19th, 1999, 10:57 AM
Hi,
you didn't mention which operating system and platform you tried this.
In Turbo C++, I think you should use Delay(...); instead of sleep();
In Windows,and VC++, you try with Sleep(..); // Capital 'S'
Include the header file "Winbase.h" also.
thanks

Samar Aarkotti
April 20th, 1999, 09:31 AM
Use delay(); instead of sleep....
SleepEx or Sleep is for the Windows application