title: std::getline does not work inside a for-loop
body: <p>I'm trying to collect user's input in a string variable that accepts whitespaces for a specified amount of time.</p>
  
  <p>Since the usual <code>cin &gt;&gt; str</code> doesn't accept whitespaces, so I'd go with std::getline from &lt;string&gt;</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;algorithm&gt;
  using namespace std;
  int main()
  {
      int n;
      cin &gt;&gt; n;
      for(int i = 0; i &lt; n; i++)
      {
          string local;
          getline(cin, local); // This simply does not work. Just skipped without a reason.
          //............................
      }
  
      //............................
      return 0;
  }
  </code></pre>
  
  <p>Any idea?</p>