C program timeout

Home Forums C Programming C program timeout

Viewing 1 reply thread
  • Author
    Posts
    • #2237
      PreciouLonon
      Participant

      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
      Participant

      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

Viewing 1 reply thread
  • You must be logged in to reply to this topic.