Thread: Problem with function sleep()

  1. #16
    Registered User
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by quzah View Post
    Well, you win some, you lose some. So read your docs and figure out what you're doing wrong.


    Quzah.
    manuals seem unintellegent about this. i really wonder whether it's XP related trouble.. i do not remember such troubles while using Win 98 in recent past..

  2. #17
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    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.

  3. #18
    Registered User
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by zacs7 View Post
    Maybe since your compiler using old 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?
    it should be 32bit.. i will investigate though. thanks for suggestion
    Last edited by vicst197; 04-05-2007 at 08:09 AM.

  4. #19
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Open up winbase.h

    Is Sleep() in there?

  5. #20
    Registered User
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by zacs7 View Post
    Open up winbase.h

    Is Sleep() in there?
    it's in there!
    Code:
    WINBASEAPI
    VOID
    WINAPI
    Sleep(
        DWORD dwMilliseconds
        );
    about compiler:
    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.

  6. #21
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    one way to find out, sizeof(int)...

    Code:
    #include <stdio.h>
    
    int main(void)
    {
        printf("&#37;d\n", sizeof(int));
        return 0;
    }
    Generally, (presuming you have a "normal" computer)
    2 = 16 bit
    4 = 32 bit
    Last edited by zacs7; 04-05-2007 at 08:13 AM.

  7. #22
    Registered User
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by zacs7 View Post
    one way to find out, sizeof(int)...

    Code:
    #include <stdio.h>
    
    int main(void)
    {
        printf("&#37;d", sizeof(int));
        return 0;
    }
    Generally, (presuming you have a "normal" computer)
    2 = 16 bit
    4 = 32 bit
    2... poor me

    maybe any1 using Borland C++ 4.51 knows how to set 32 compiler up?

  8. #23
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Perhaps its time for a new compiler?

    If you want something simple with an IDE, then look into DevC++ (outdated), LCC/LCC~Win32 or PellesC (yummy)

  9. #24
    Registered User
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by zacs7 View Post
    Perhaps its time for a new compiler?

    If you want something simple with an IDE, then look into DevC++ (outdated), LCC/LCC~Win32 or PellesC (yummy)
    Well.. Borland C++ 4.51, which i use has a 32 bit compiler. i just need to set it up so i will read manuals again and meantime if any1 having experience with this would drop a line would be gr8! thanks for helping me Gr8 forum really!

  10. #25
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    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.

  11. #26
    Registered User
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by zacs7 View Post
    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.

    well, it's money problem. ... i hope to make 32bit compiler working!
    Last edited by vicst197; 04-05-2007 at 08:32 AM.

  12. #27
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Money as in bandwidth? Cause those compilers are free :\

  13. #28
    Registered User
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by zacs7 View Post
    Money as in bandwidth? Cause those compilers are free :\
    i'll try (that link to PellesC does not seem working though)

  14. #29
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    It's a C compiler anywho, You probably want C++ and C... Ie DevC++

  15. #30
    Registered User OnionKnight's Avatar
    Join Date
    Jan 2005
    Posts
    555
    I'm pretty sure the Borland compilers have sleep(). At least in the later versions, IIRC it's prototyped in stdlib.h.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. why do we require sleep?
    By jinx in forum A Brief History of Cprogramming.com
    Replies: 43
    Last Post: 07-14-2004, 08:21 AM
  4. Replies: 5
    Last Post: 02-08-2003, 07:42 PM
  5. I need help with passing pointers in function calls
    By vien_mti in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 10:00 AM