title: How to simulate an EOF?
body: <p>I am currently reading K&amp;R's book and typing in the examples from the first section, and there are a couple of examples such as this:</p>
  
  <pre><code>while((c = getchar()) != EOF) {
      //do something
  }
  </code></pre>
  
  <p>I am testing these examples on a Windows box and thus running the compiled exe files from the <code>cmd</code> prompt.</p>
  
  <p>To test the example above, how do I simulate an <code>EOF</code>?  That is, basically how can I make the loop stop when testing the example from the command prompt?</p>