 <p>You need to: </p> <ol> <li>fork the process</li> <li>call one of the "exec" functions in the child process</li> <li>(if necessary) wait for it to stop</li> </ol> <p>For example, this program runs <code>ls</code>. </p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;unistd.h&gt; #include &lt;sys/wait.h&gt; // for example, let's "ls" int ls(const char *dir) { int pid, status; // first we fork the process if (pid = fork()) { // pid != 0: this is the parent process (i.e. our process) waitpid(pid, &amp;status, 0); // wait for the child to exit } else { /* pid == 0: this is the child process. now let's load the "ls" program into this process and run it */ const char executable[] = "/bin/ls"; // load it. there are more exec__ functions, try 'man 3 exec' // execl takes the arguments as parameters. execv takes them as an array // this is execl though, so: // exec argv[0] argv[1] end execl(executable, executable, dir, NULL); /* exec does not return unless the program couldn't be started. when the child process stops, the waitpid() above will return. */ } return status; // this is the parent process again. } int main() { std::cout &lt;&lt; "ls'ing /" &lt;&lt; std::endl; std::cout &lt;&lt; "returned: " &lt;&lt; ls("/") &lt;&lt; std::endl; return 0; } </code></pre> <p>And the output is:</p> <pre><code>ls'ing / bin dev home lib lib64 media opt root sbin srv tmp var boot etc initrd.img lib32 lost+found mnt proc run selinux sys usr vmlinuz returned: 0 </code></pre>