title: C++ Execute a command line and get Result.
body: <p>I need some help with my situation. I want to execute a Terminal and get the Result. I have done it so far, but i want to do some other Commands after getting the Result. My Problem is, that everytime when i do a command, the console restarts, and i dont know how to write in a active prozess.</p>
  
  <p>I have done it like that:</p>
  
  <pre><code>FILE *fp = popen(r.c_str(),"r");
      char buf[2560];
  
      while (fgets(buf, 2560, fp))
      {
          s-&gt;SendLine(buf);
      }
      fclose(fp);
  </code></pre>
  
  <p>I want to "send" another command in the same process. How can i do that?</p>