Thread: system(/*stuff */

  1. #1
    Unregistered
    Guest

    system(/*stuff */

    Does anybody have a list of things that you can use in a system() call?

  2. #2
    Unregistered
    Guest
    The system command passes a NULL terminated string to the command interpreter. That means you can invoke any internal command (built into command.com in DOS say; like "cls", or "dir"), or any external command, that is, an executable program, batch file etc stored on your hard drive.

    Basically, if you're at the C:\> prompt, and you type a command that does something, runs a program etc, you can do that with a system command.

    I'm sure there are limitations, and if you have some code that doesn't work, post it, and someone here will help.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    63
    just include stdlib.h

    and to execute a command type the following:

    system("CLS"); //clears the screen
    system("pause"); //press any key to continue
    system("ping 127.0.0.1"); //ping yourself

    Hope this helps
    tudehopet uses Borland Compiler 5.5
    and Visual C++ 6.

Popular pages Recent additions subscribe to a feed