title: End of File in stdin
body: <p>A question about this has been asked here
  <a href="https://stackoverflow.com/questions/4358728/end-of-file-eof-in-c">End of File (EOF) in C</a>
  but it still doesn't completely solve my problem.</p>
  
  <p><code>EOF</code> makes sense to me in any datastream which is not <code>stdin</code>, for example if I have some <code>data.txt</code> file, <code>fgetc()</code> will read all the chars and come to the end of file and return <code>-1</code>.</p>
  
  <p>What I don't understand is the concept of <code>EOF</code> in <code>stdin</code>. If I use <code>getchar()</code>, it will wait for me to enter something, so if there is NOTHING written, End of File, (<code>EOF</code>) is not returned automatically?</p>
  
  <p>So is it that only the user can invoke <code>EOF</code> in <code>stdin</code> by pressing <kbd>Ctrl</kbd>+<kbd>Z</kbd>? 
  If so then what are some of the uses of <code>EOF</code> in <code>stdin</code>? I guess it tells the program to continue reading until the user invokes end of file? is this it?</p>
  
  <p>Thank you</p>