title: Need help with getline()
body: <p>Is there a reason why if in my program I am asking the user for input, and I do:</p>
  
  <pre><code>int number;
  string str;
  int accountNumber;
  
  cout &lt;&lt; "Enter number:";
  cin &gt;&gt; number;
  cout &lt;&lt; "Enter name:";
  getline(cin, str);
  cout &lt;&lt; "Enter account number:";
  cin &gt;&gt; accountNumber;
  </code></pre>
  
  <p>Why after inputting the first number, it outputs "Enter Name", followed immediately by "Enter Account Number" before I even get to input my "str" for the getline(cin, str) line?  Thanks!</p>