std::system (3) - Linux Manuals
std::system: std::system
NAME
Synopsis
Defined in header <cstdlib>
int system( const char* command );
Calls the host environment's command processor (e.g. /bin/sh, cmd.exe, command.com) with the parameter command. Returns an implementation-defined value (usually the value that the invoked program returns).
If command is a null pointer, checks if the host environment has a command processor and returns a nonzero value if and only if the command processor exists.
Parameters
command - character string identifying the command to be run in the command processor. If a null pointer is given, command processor is checked for existence
Return value
Implementation-defined value. If command is a null pointer, returns a nonzero value if and only if the command processor exists.
Notes
On POSIX systems, the return value can be decomposed using WEXITSTATUS_and_WSTOPSIG
The related POSIX function popen makes the output generated by command available to the caller.
Example
// Run this code
Possible output:
See also