title: c++ cin input not working?
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  struct Car{
      std::string model;
      unsigned int year;
  };
  
  int main(){
      using namespace std;
  
      int carNum;
      cout &lt;&lt; "How many cars do you wish you catalog? ";
      cin &gt;&gt; carNum;
      Car * cars = new Car[carNum];
  
      for (int i=0;i&lt;carNum;i++){
          cout &lt;&lt; "Car #" &lt;&lt; i &lt;&lt; endl;
          cout &lt;&lt; "Please enter the make: ";
          getline(cin, cars[i].model);
  
          cout &lt;&lt; "Please enter the year made: ";
          cars[i].year = cin.get();
      }
  
      cout &lt;&lt; "Here's your collection" &lt;&lt; endl;
  
      for (int i=0;i&lt;carNum;i++){
          cout &lt;&lt; cars[i].model &lt;&lt; " " &lt;&lt; cars[i].year &lt;&lt; endl;
      }
  
      delete [] cars;
  
      return 0;
  }
  </code></pre>
  
  <p>When i execute the program, the <code>getline(cin, car[i].model)</code> just get skipped over. Why is this?</p>
  
  <p>like this:</p>
  
  <blockquote>
  <pre><code>Car #2
  Please enter the make: Please enter the year made:
  </code></pre>
  </blockquote>