title: c++ getline() isn't waiting for input from console when called multiple times
body: <p>I'm attempting to get a few user-input parameters from the console, two strings, two ints and a double. The relevant code I'm trying to use is this:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  // ...
  
  string inputString;
  unsigned int inputUInt;
  double inputDouble;
  
  // ...
  
  cout &lt;&lt; "Title: "; 
  getline(cin, inputString);
  tempDVD.setTitle(inputString);
  
  cout &lt;&lt; "Category: "; 
  getline(cin, inputString);
  tempDVD.setCategory(inputString);
  
  cout &lt;&lt; "Duration (minutes): "; 
  cin &gt;&gt; inputUInt; 
  tempDVD.setDuration(inputUInt);
  
  cout &lt;&lt; "Year: "; 
  cin &gt;&gt; inputUInt; 
  tempDVD.setYear(inputUInt);
  
  cout &lt;&lt; "Price: $"; 
  cin &gt;&gt; inputDouble; 
  tempDVD.setPrice(inputDouble);
  </code></pre>
  
  <p>However, when running the program, instead of waiting for the first inputString to be entered, the code doesn't stop until the second getline() call. Thus the console output looks like this:</p>
  
  <blockquote>
    <p>Title: Category:</p>
  </blockquote>
  
  <p>with the cursor appearing after category. If I input now, the program then jumps ahead to the year input, not allowing me to enter more than one string. What's happening here?</p>