K&R book 1.5.1 File Copying
<p>I have looked around the site regarding this K&amp;R example and the answers seem to revolve around 'why is this a type int or what is EOF?' kinda guys. I believe that I understand those. 
It's the results that I don't understand. I had expected this code to take a single character, print it and then wait for another character or EOF.</p>

<p>The results that I see are the input waiting until I press return, then everything that I typed shows up and the more waiting for input. </p>

<p>Is the while loop just 'looping' until I end the text stream with the carrage return and then shows what putchar(c) has been hiding somewhere? </p>

<p>The code is:</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>Now, if I sneak a putchar(c) before on the line just before the while, I sort of get what I expected. I still must enter a text stream and press return. The result is the first character of the stream and the program exits. </p>

<p>Evidently there is a big picture gap for me going on. </p>

<p>Thank you for your help</p>