title: Running gdb while passing in a file from standard input c
body: <p>So, when I run my program, I do</p>
  
  <pre><code>./a.out &lt; SampleData
  </code></pre>
  
  <p>How would I debug my program while still being able to pass in the SampleData file?</p>
  
  <p>Thanks</p>
  
  <p>Edited: I tried doing</p>
  
  <pre><code>gdb ./a.out
  run &lt; SampleData
  </code></pre>
  
  <p>when I do it, it runs my program, outputs what it normally outputs, then leaves me with:</p>
  
  <p>"[Inferior 1 (process 19460) exited with code 03]"</p>
  
  <p>What?</p>