Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdlib.h>
    int system( const char *command );

Description:
    If the value of command is NULL, then the system function determines
    whether or not a command processor is present (COMMAND.COM in DOS or
    CMD.EXE in OS/2).

    Otherwise, the  system function invokes a copy of the command processor,
    and passes the string command to it for processing.  This function uses
     spawnl to load a copy of the command processor identified by the
     COMSPEC environment variable.

    This means that any command that can be entered to DOS can be executed,
    including programs, DOS commands and batch files.  The  exec...  and
     spawn...  functions can only cause programs to be executed.

Returns:
    If the value of command is NULL, then the system function returns zero
    if the command processor is not present, a non-zero value if the command
    processor is present.

    Otherwise, the system function returns the result of invoking a copy of
    the command processor.  A non-zero value is returned if the command
    processor could not be loaded; otherwise, zero is returned.  When an
    error has occurred,  errno contains a value indicating the type of error
    that has been detected.

See Also:
    abort, atexit, _bgetcmd, exec Functions Functions, exit, _exit, getcmd, getenv,
    main, onexit, putenv, spawn Functions Functions

Example:
    #include <stdlib.h>
    #include <stdio.h>

    void main()
      {
        int rc;

        rc = system( "dir" );
        if( rc != 0 ) {
          printf( "shell could not be run\n" );
        }
      }

Classification:
    ANSI, POSIX 1003.2

Systems:
    All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson