system function


The system function is used to issue a DOS/Unix command. Execution of your program will not continue until the command has completed.

You will not be able to get the return code from the command or have access to the command output via system. If you need access to the O/P consider using popen to execute the command.


  Library:   stdlib.h

  Prototype: int system(const char *cmd);

  Syntax:    system( "cat /etc/hosts");

  Notes:
             In Unix systems, the command is passed to "/bin/sh -c" for 
             execution. I do not know what handles the command in DOS systems.

example program.


See Also:


Top Master Index Keywords Functions


Martin Leslie