C program timeout

Home Forums C Programming C program timeout

This topic contains 1 reply, has 2 voices, and was last updated by  Chandra3993 9 years, 9 months ago.

  • Author
    Posts
  • #2237

    PreciouLonon
    Member

    Here is the program I have at the moment

    I want to add a timeout function on the if statement in blue and then clear the screen with system(“cls”); Any help on how to create the timeout function?

    I am using Dev C++ compiler and what I am trying to do is asking a user to enter a purchase amount, if it is negative I am giving them a message it must be positive then after about 10 second clear the screen so they can reenter a proper purchase price.

  • #3626

    Chandra3993
    Member

    You use can sleep function for prompting to require amount of time.

    In condition you add the sleep(10).

    It will wait for 10 seconds, then do the require stuffs

You must be logged in to reply to this topic.

Share
Tweet
Share
Pin