title: Reading in a filename from echo command in C
body: <p>I was wondering what's the best way to read in a filename in C when the name is echoed on the command line, as in: if I type in</p>
  
  <pre><code>echo test.txt | a1
  </code></pre>
  
  <p>how would I access the <code>test.txt</code> using 
  <code>fopen(fname, "r");</code>?</p>