title: how to store the output of system() call?
body: <p>I am using <code>system(3)</code> on Linux in c++ programs. Now I need to store the output of <code>system(3)</code> in an array or sequence. How I can store the output of <code>system(3)</code>.</p>
  
  <p>I am using following:</p>
  
  <pre><code>system("grep -A1 \"&lt;weakObject&gt;\" file_name | grep \"name\" |
      grep -Po \"xoc.[^&lt;]*\" | cut -d \".\" -f5 ");  
  </code></pre>
  
  <p>which gives output:</p>
  
  <pre><code>changin 
  fdjgjkds 
  dglfvk
  dxkfjl
  </code></pre>
  
  <p>I need to store this output to an array of strings or Sequence of string.</p>
  
  <p>Thanks in advance</p>