This is a discussion on Problem with function sleep() within the C Programming forums, part of the General Programming Boards category; Originally Posted by quzah Well, you win some, you lose some. So read your docs and figure out what you're ...
Maybe since your compiler is old its using an old windows.h (pre Win95)?
The requirments for Sleep() are:
Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95
Sure its not a 16bit compiler?
Last edited by zacs7; 04-05-2007 at 08:00 AM.
Open up winbase.h
Is Sleep() in there?
it's in there!
about compiler:Code:WINBASEAPI VOID WINAPI Sleep( DWORD dwMilliseconds );
i do not know how to find out which compiler is used (i compile in IDE window by pressing a button) but it should be 32bit compiler. i think so coz both 16bit and 32bit compilers are available and perhaps it decides automatically which one to use.
Last edited by vicst197; 04-05-2007 at 08:08 AM.
one way to find out, sizeof(int)...
Generally, (presuming you have a "normal" computer)Code:#include <stdio.h> int main(void) { printf("%d\n", sizeof(int)); return 0; }
2 = 16 bit
4 = 32 bit
Last edited by zacs7; 04-05-2007 at 08:13 AM.
Why are you so keen on Borland C++ 4.51?, Borland C++ 4.00 was released in 1993 (thats well over 10 years ago). If you plan on doing windows programming at least update the includes & libs.
Money as in bandwidth? Cause those compilers are free :\
It's a C compiler anywho, You probably want C++ and C... Ie DevC++
I'm pretty sure the Borland compilers have sleep(). At least in the later versions, IIRC it's prototyped in stdlib.h.