Arguments for system()

Is it possible to have arguments for the system command. For Example,
system(gcc %s, "Main.c");
Build the whole command into a string.

1
2
std::string s("echo beans on toast");
system(s.c_str());


Also, consider not using system and instead using one of the API provided commands for starting a process.
Last edited on
Topic archived. No new replies allowed.