What does this error mean?

This is a discussion on What does this error mean? within the C Programming forums, part of the General Programming Boards category; Hi guys, I am using Borland C++ Builder 6.0 I have this statement in my program Code: sleep(1000); with the ...

  1. #1
    Unregistered
    Guest

    What does this error mean?

    Hi guys,

    I am using Borland C++ Builder 6.0

    I have this statement in my program
    Code:
    sleep(1000);
    with the nesscary header and stuffs but an error is given...

    Code:
    [C++ Warning] inventory.cpp(76): W8053 'sleep(unsigned int)' is obsolete
    What does it mean and how to slove it?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >What does it mean and how to slove it?
    It means that Borland has something better for you to use if this is their sleep function. Read your documentation about sleep to find out what to use instead.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    hm strange indeed. perhaps there's an alternative that your compiler supplies, but it looks like you are using a DOS platform. can you give us your exact platform and which compiler you are using? if it is DOS indeed i can say that i've never seen anything like that. also perhaps in a C++ specific library [as opposed to a C one] there is an updated function, but i've not heard of anything of that sort just yet...
    hasafraggin shizigishin oppashigger...

  4. #4
    Unregistered
    Guest
    Oh I see.. Thanks alot for your help

  5. #5
    Unregistered
    Guest
    Hi,

    O/S: Windows XP [5.1.2600]
    Compiler: Borland C++ Builder 6 Enterprise Edition

    maybe it will help if I post my codes here, please don't laugh because I am a newbie at c programming. :P

    Code:
    /* Header Files */
    #include <stdlib.h>
    #include <stdio.h>
    #include <conio.h>
    #include <string.h>
    #include <ctype.h>
    #include <time.h>
    #include <dos.h>
    
    
    /* Define Functions */
    void displayMenu();
    void addRecord();
    void delRecord();
    void editRecord();
    void listRecord();
    void searchRecord();
    
    
    /* Declearations */
    
    
    
    /* MAIN Function */
    void main(void) {
    displayMenu();
    getch();
    }
    
    
    /* menu Functions */
    void displayMenu(void) {
            int op;
            do {
            clrscr();
            printf("1. Add Products\n");
            printf("2. Delete Products\n");
            printf("3. Edit Products\n");
            printf("4. List Products\n");
            printf("5. Search Products\n");
            printf("6. Exit Inventory\n");
            printf("Please select one: ");
            scanf("%i", &op);
            switch (op) {
                    case 1:
                            addRecord();
                            break;
                    case 2:
                            delRecord();
                            break;
                    case 3:
                            editRecord();
                            break;
                    case 4:
                            listRecord();
                            break;
                    case 5:
                            searchRecord();
                            break;
                    case 6:
                            exit;
                            break;
                    default:
                            printf("Invalid Choice");
                            getch();
                            sleep(1000);
                            displayMenu();
                            break;
            }
    } while ((op < 1) && (op > 6));
    }
    
    
    /* addRecord Functions */
    void addRecord(void) {
    printf("ADD RECORD");
    }
    
    
    /* delRecord Functions */
    void delRecord(void) {
    printf("DELETE RECORD");
    }
    
    
    /* editRecord Functions */
    void editRecord(void) {
    printf("EDIT RECORD");
    }
    
    
    /* listRecord Functions */
    void listRecord(void) {
    printf("LIST RECORD");
    }
    
    
    /* searchRecord Functions */
    void searchRecord(void) {
    printf("SEARCH RECORD");
    }

  6. #6
    Im back! shaik786's Avatar
    Join Date
    Jun 2002
    Location
    Bangalore, India
    Posts
    345
    >void main(void)
    void main() is wrong. int main() is right. Search the forums for the reson why.

    >void displayMenu();
    When declaring function prototypes, put a void in the parameter list when the function does not take any parameter. When you leave blank, means the function can take any number of parameters. Like:
    void displayMenu(void);

    >} while ((op < 1) && (op > 6));
    Wrong logic when you are expecting the user to enter values between 1 and 6. Should be:
    while((op > 1) && (op < 6))

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21