title: How to pass an input and retrieve an output to a child process in C language
body: <p>I have an exe program in Windows which in the terminal works as follows</p>
  
  <pre><code>&gt; program.exe parameter01 file
  entry01 (user types entry01)
  output01
  entry02 (user types entry02)
  output02
  ...
  until the combination Ctrl+D is pressed.
  </code></pre>
  
  <p>I need to create a "child process" in a C language which is capable to run the program and sent entries to the "child process" and receive the output in a char[] or string.</p>
  
  <p>I know I have to use the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx" rel="nofollow noreferrer">CreateProcess method</a> but I don't know how to pass an entry like an input and retrieve the output, How can I do this?</p>
  
  <p>I have seen this <a href="https://stackoverflow.com/questions/11241800/how-to-pipe-inputstream-to-processbuilder/11825292#comment31395034_11825292">using Java</a> but I need to implement this functionality in C language.</p>