system("PAUSE")

how does 'system("PAUSE")' actually *work*? like how should i go about making my own ones with custom messages?

Comments

  • : how does 'system("PAUSE")' actually *work*? like how should i go about making my own ones with custom messages?
    :
    :

    the system() function just simply executes other programs. In you example it runs the MS-DOS command.com (or cmd.exe) internal function named "pause". You can test this out yourself by typing "pause" in a command prompt.
  • So is this you make a program that runs multiple programs within it? If I wanted to make a program that sequentially ran three different .exe's inside it, would the code look somewhat like this?

    int main()
    {
    system("program1.exe");
    system("program2.exe");
    system("program3.exe");
    }


  • : So is this you make a program that runs multiple programs within it? If I wanted to make a program that sequentially ran three different .exe's inside it, would the code look somewhat like this?
    :
    : int main()
    : {
    : system("program1.exe");
    : system("program2.exe");
    : system("program3.exe");
    : }

    Well, you could, but you risk problems with certain procedures the programs may run internally. It might crash. Here is some code that compiles under Borland C/C++ 4.52 for DOS that puts a pause message on screen. And you can control the message.
    [code]
    #include //Includes necessary header files, old style
    #include


    int main(void) //The venerable main function
    {
    clrscr(); //Clears the screen
    gotoxy(5,22); // Places the cursor back at the bottom and left
    cout << "Hit <Enter> to continue..."; // Displays message
    cin.get(); // Waits for enter key
    return(0); // Returns 0 so DOS doesn't flip out
    }
    [/code]
  • : So is this you make a program that runs multiple programs within it? If I wanted to make a program that sequentially ran three different .exe's inside it, would the code look somewhat like this?
    :
    : int main()
    : {
    : system("program1.exe");
    : system("program2.exe");
    : system("program3.exe");
    : }
    :
    :
    :

    yes, that's one of several ways to do it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories