title: I'm trying to understand getchar() != EOF
body: <p>I'm reading The C Programming Language and have understood everything so far.
  However when I came across the <code>getchar()</code> and <code>putchar()</code>, I failed to understand what is their use, and more specifically, what the following code does.</p>
  <pre><code>main()
  {
      int c;
      while ((c = getchar()) != EOF)
         putchar(c);
  }
  </code></pre>
  <p>I understand the <code>main()</code> function, the declaration of the integer <code>c</code> and the <code>while</code> loop. Yet I'm confused about the condition inside of the <code>while</code> loop. What is the input in this C code, and what is the output.</p>