title: Piping stdout in C
body: <p>I would like to know how can I pipe stdout in c. Here is an example of piping the stdout of the command 'ls' from linux, storing it in a variable, and then printing the value of the variable:</p>
  
  <pre><code>import subprocess
  #Piping stdout of the command 'ls' from linux
  test = subprocess.Popen("ls", stdout = subprocess.PIPE)
  stdoutpiped = test.stdout.read().decode('utf-8')
  print(stdoutpiped)
  </code></pre>
  
  <p>Results from the running code:</p>
  
  <pre><code>Destkop
  Documents
  Images
  Videos
  Downloads
  MyCodes
  passwords.txt
  </code></pre>
  
  <p>How would you do this in <code>c</code>? </p>
  
  <p>Thank you!</p>