title: Why doesn't the EOF character work if put at the end of a line?
body: <p>I'm learning C++ and trying to understand, <br/>
  Why doesn't the EOF character (Ctrl + Z on Windows) break the while loop if put at the end of a line?</p>
  <p>My code:</p>
  <pre><code>    int main() {
          char ch;
          while(cin &gt;&gt; ch) {
              cout &lt;&lt; ch;
          }
      }
  </code></pre>
  <p>When I enter ^Z, the loop breaks; <br/>
  But when I enter 12^Z, it doesn't.</p>