title: why while loop do not need user to input in c++
body: <p>I'm learning c++ and reading c++ primer plus, but I don't understand why this code need two "cin >> ch". I know the first cin will read character that was user input.but then I delete first "cin >> ch" and run code ,the program have no error.So the fist cin is necessary? why the second cin needn't user to input?</p>
  
  <pre><code>#include &lt;iostream&gt;
  int main()
  {
      using namespace std;
      char ch;
      int count = 0;
      cout &lt;&lt; "Enter characters; enter # to quit:\n";
      cin &gt;&gt; ch; //get a character
      while (ch != '#')
      {
          cout &lt;&lt; ch;
          ++count;
          cin &gt;&gt; ch; // get the next character
      }
      cout &lt;&lt; endl &lt;&lt; count &lt;&lt; " characters read\n";
      return 0;
  }
  </code></pre>