Pausing

This is a discussion on Pausing within the C++ Programming forums, part of the General Programming Boards category; Can anyone give me any code to pause a DOS application for a few seconds, and then end the programming; ...

  1. #1
    CloudNine
    Guest

    Unhappy Pausing

    Can anyone give me any code to pause a DOS application for a few seconds, and then end the programming;

    Thanks in advance

    CloudNine

  2. #2
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Instead of the
    Code:
     
    return 0;
     }
    use the
    Code:
    system("PAUSE");
    return 0;
      }
    as soon as a user presses any key and hits enter, the program will terminate.

  3. #3
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    He said pause for a few seconds!
    include windows.h and use

    Sleep(milliseconds);

    for example

    Sleep(3000);

    would pause for 3 seconds

  4. #4
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    For that you might have to include the conio header anyhow, or the time.h file

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    its either sleep(a value);
    or _sleep(a value);
    depending on what compiler u use

    if u got borland u can use

    delay(a value);

    i think the header for the sleeps i <stdlib.h>
    and delay i think <dos.h>

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pausing script to read output
    By a_priebe47 in forum C Programming
    Replies: 1
    Last Post: 06-15-2004, 11:16 PM
  2. pausing functions..
    By bluehead in forum C++ Programming
    Replies: 3
    Last Post: 01-13-2002, 03:27 AM
  3. Functions and pausing
    By dv916 in forum C++ Programming
    Replies: 4
    Last Post: 12-28-2001, 05:43 PM
  4. MS DOS not pausing while waiting for imput.
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-14-2001, 09:06 PM
  5. pausing the system
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 10-18-2001, 01:34 PM

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