title: getchar() and conditioning a loop to break with a specific char
body: <p>I am working on the infamous book "Prentice Hall Software Series" and trying out the Code they write and modifying it to learn more about C.</p>
  
  <p>I am working with VIM on Fedora 25 in the console. The following code is a quote from the book, I know "int" is missing as well as argc and argv etc. </p>
  
  <p><em>Kernighan and Ritchie - The C Programming Language: Page 20</em></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  /* copy input to output; 1st version  */   
  main(){       
      int c;
      c = getchar();       
      while (c != EOF) {           
          putchar(c);           
          c = getchar();       
      }   
  }
  </code></pre>
  
  <p>With this code I couldn't manage to get the "EOF" to work. I am not sure if "ctr + z" really is the real thing to do, since it quits any console program in console.</p>
  
  <p>Well since I was unsure i changed the condition to</p>
  
  <pre><code>...
  while (c != 'a') {
  ...
  </code></pre>
  
  <p>So normally if I enter 'a' the while condition should break and the programm should terminate. Well it does not when I try to run it and enter 'a'. What is the problem here?</p>
  
  <p>Thank you guys!</p>