title: Allowing User Input with Whitespace?
body: <p>I'm trying to get user input for a function. The following code works, but not when there is a space between words.</p>
  
  <pre><code>string cityNew;
  string cityPrevious;
  cout&lt;&lt;"Enter a city name:"&lt;&lt;endl;
  cin&gt;&gt;cityNew;
  cout&lt;&lt;"Enter a previous city name:"&lt;&lt;endl;
  cin&gt;&gt;cityPrevious;
  comNet.addCity(cityPrevious, cityNew);
  </code></pre>
  
  <p>I've attempted using <code>getline(cin,cityNew)</code> but this causes both <code>cout</code> statements to print before allowing for the user to input anything. </p>