Results 1 to 5 of 5

Thread: system("PAUSE")

  1. #1
    Junior Member
    Join Date
    Jul 2004


    I am writing a C++ program. I am using the function "system("PAUSE"); ". I was wondering how I could make it do the same thing just not the the
    words " Press any key to continue....".

  2. #2
    Join Date
    Sep 2004
    I don't know if that's possible, but try this:

    Set the program into a loop, until whatever condition is met. (ie while x do y, if z do whatever.)
    This way, you will have full control over both the message (if any) and the action to resume the program.

  3. #3
    why use the system("PAUSE"); command, if the only thing you want is wait for a keystroke, then do it like this:

    #include <stdio.h>
    int main(void)
              char c;
              return 0;
    the getch() function works only on windows (with the standard libraries at least) and otherwise you could use the getchar() function.
    this way the system is waiting for a keystroke before the program continues...

  4. #4
    Custom User
    Join Date
    Oct 2001
    you also need the conio.h header file included in order to use getch()


  5. #5
    yes, thats right (if your programming for linux). otherwise you could use the getchar() function for it...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.