Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/ C++time delay problem

  1. Mar 22, 2013 #1
    Hello! I was writing a basic program and was wondering about this problem:-

    when i give exit(0); the compiler exits as soon as that part of code is reached. Is there any piece of code such that after it reaches that part of code, it waits for some time before executing exit command? This can be used in case when upon exit, a message is to be displayed.

    Thank you in advance
     
  2. jcsd
  3. Mar 22, 2013 #2

    jedishrfu

    Staff: Mentor

  4. Mar 22, 2013 #3
    thanks! :)
     
  5. Mar 22, 2013 #4

    rcgldr

    User Avatar
    Homework Helper

    In your program you could include code just before the exit(0) to display a message to indicate the user should press the enter key, then wait for user input.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: C/ C++time delay problem
  1. Time Delay in C++. (Replies: 18)

  2. C++ time (Replies: 4)

  3. C++ Time Delay (Replies: 4)

  4. Timing mechanism in C (Replies: 19)

Loading...