title: How can I send output from a Linux child process to the parent?
body: <p>I execute a shell command (<code>cmp</code>) using <code>system()</code> from the parent process:</p>
  <pre class="lang-c prettyprint-override"><code>system(&quot;cmp file0 file1&quot;);
  </code></pre>
  <p>If the 2 files are different, the cmp program writes things to the terminal. For example:</p>
  <pre class="lang-none prettyprint-override"><code>&quot;000.jpg 001.jpg differ: byte 4, line 1&quot;
  </code></pre>
  <p>But I need this text in a <code>char *string</code> variable in the parent process and not in the console terminal.</p>