In <windows.h>
there is a function called "Sleep()"
can you tell me the definetion of this?
why does it not work when it's small "sleep()"...
Thanks...
In <windows.h>
there is a function called "Sleep()"
can you tell me the definetion of this?
why does it not work when it's small "sleep()"...
Thanks...
Sleep(int MilliSeconds) is a windows.h function that halts execution of the program for a set amount of milliseconds. There is another function sleep(int seconds) which lies in stdlib.h (I think, may be wrong though) which does the same but the argument is in seconds rather than milliseconds.
C/C++ is case sensitive. Small or captial letters matter.why does it not work when it's small "sleep()"...
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Sleep()
Lowercase "sleep()" is POSIX and standard C (C99) and is in <unistd.h>. It's not in the Microsoft C-lib however.
gg
BTW to convert millseconds to seconds just divide by 1000.
Edit-----------------------------------------
Read lower post.
Last edited by CheesyMoo; 03-29-2003 at 04:19 PM.
If you ever need a hug, just ask.
You mean by a thousand don't you? And to go from seconds to milliseconds you multiply by a thousand.BTW to convert millseconds to seconds just divide by 100.
~ Paul
It ain't listed in my copy of C99 Me's a thinking you're wrong on that one.Originally posted by Codeplug
Lowercase "sleep()" is POSIX and standard C (C99) and is in <unistd.h>. It's not in the Microsoft C-lib however.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
You're right!!
I was referencing this table and I must have looked at the wrong row.
gg