spawnc

Create a new thread and execute a new program within it using a command line.

int spawnc (int mode, char * command);

Required Header
<process.h>

Return Value

If the mode is WAIT then the return value is the return code from the new program. The NOWAIT option returns a handle to the new thread. -1 indicates an error.

Parameters

mode

  The wait mode

command

  The command line to execute

Remarks

The spawnc function starts a new thread using the _beginthread function and optionally waits for its termination using the _syncthread function.

The new thread uses the system function to execute the command.

The value of mode can be one of: WAIT or NOWAIT.

Process and Threads

See Also    _beginthread, _endthread, spawn, _syncthread, system