title: Run Another Program in Linux from a C++ Program
body: <p>Okay so my question is this. Say I have a simple C++ code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main(){
     cout &lt;&lt; "Hello World" &lt;&lt; endl;
     return 0;
  }
  </code></pre>
  
  <p>Now say I have this program that I would like to run in my program, call it prog. Running this in the terminal could be done by:</p>
  
  <pre><code>./prog
  </code></pre>
  
  <p>Is there a way to just do this from my simple C++ program? For instance</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main(){
     ./prog ??
     cout &lt;&lt; "Hello World" &lt;&lt; endl;
     return 0;
  }
  </code></pre>
  
  <p>Any feedback would be very much obliged.</p>