title: Why getline does not work in a switch, and cin does not take the data appropriately?
body: <p>I need to take in the make model and years of the car the particular product fits. The program is going to write a file with text in it that will be an outline of the html. I need with the crucial information inserted into the correct spots to quickly be able to add products to our web page. When I use a switch statement or if statements to separate the categories of the products, the input gets messed up and does not let me answer one of the questions. I can't just use cin because I need to take dates that look like &quot;2008 - 2009 - 2010 - 2011&quot;.</p>
  <p>Here is what I've got so far! This one is just regular <code>cin</code>, I have tried <code>getline</code> you could quickly c I started yesterday and I'm pretty new so forgive me if this is an easy fix, but I cant find anything.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  void proinfo();
  
  int main()
  {
      //Sytem Information
      system(&quot;TITLE This is a Beta of My Product Information Template Version 0.0.2&quot;);
  
      //I'm using this as a welcome screen to inform users of new improvements on patches and other pertinent information to the users
      cout &lt;&lt; &quot;Welcome To My Product Information Template Maker!!! \n It Is Still In Development&quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;\n\nworking features are:&quot; &lt;&lt; endl &lt;&lt; &quot;\t-None\n&quot; &lt;&lt; endl;
      system(&quot;PAUSE&quot;);
      system(&quot;CLS&quot;);
      proinfo();
  }
  
  void proinfo()
  {
      //Declare Variables here
      int loop(1), protype;
      char make[256], model[256], year[256];
      string getinput;
  
      while(loop==1)
      {
          //This is the first menu the user sees where they have to choose what type 
          //of products users will be adding
          system(&quot;CLS&quot;);
          cout &lt;&lt; &quot;Welcome to My Product Information Template Version 0.0.0&quot; &lt;&lt; endl;
  
          cout &lt;&lt; &quot;Please select the number of the product&quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;type you will be ading!\n&quot; &lt;&lt; endl;
  
          cout &lt;&lt; &quot;1.Fe - Fe2 Moldings&quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;2.CF - CF2 Moldings&quot; &lt;&lt; endl;
  
          cout &lt;&lt; &quot;What would you like to do? &quot;;
  
          cin &gt;&gt; protype;
  
          if(protype==1)
          {
              //FE - FE2 Molding
              system(&quot;cls&quot;);
  
              cout &lt;&lt; &quot;You have selected&quot; &lt;&lt; endl;
              cout &lt;&lt; &quot;Fe - Fe2 Moldings\n&quot; &lt;&lt; endl;
  
              cout &lt;&lt; &quot;Please Enter the Make of the molding&quot; &lt;&lt; endl;
              cin &gt;&gt; make;
  
              cout &lt;&lt; &quot;Please Enter the Model of the molding&quot; &lt;&lt; endl;
              cin &gt;&gt; model;
  
              cout &lt;&lt; &quot;Please Enter the Years this molding fits&quot; &lt;&lt; endl;
              cin &gt;&gt; year;
  
              cout &lt;&lt; &quot;You have just created a template for a(n)&quot; &lt;&lt; year &lt;&lt; &quot; &quot; &lt;&lt; make &lt;&lt; &quot; &quot; &lt;&lt; model &lt;&lt; endl;
              cout &lt;&lt; &quot;Check My Documents For a file called Fe-Fe2template.txt&quot; &lt;&lt; endl;
  
              //Asks to quit or restart
              cout &lt;&lt; &quot;Would you like to make another tempalte?&quot; &lt;&lt; endl;
  
              cin &gt;&gt; getinput;
  
              if(getinput==&quot;yes&quot;)
              {
                  cout &lt;&lt; &quot;Great, Lets keep working!&quot; &lt;&lt; endl;
                  //End of If statement
              }
  
              system(&quot;PAUSE&quot;);
          }
  
          if(protype==2)  
          {
              //CF - CF2 Molding
              system(&quot;cls&quot;);
  
              //Asks to quit or restart
              cout &lt;&lt; &quot;Would you like to make another tempalte?&quot; &lt;&lt; endl;
  
              cin &gt;&gt; getinput;
  
              if(getinput==&quot;yes&quot;)
              {
                  cout &lt;&lt; &quot;Great, Lets keep working!&quot; &lt;&lt; endl;
                  //End of If statement                   
              }
  
              system(&quot;PAUSE&quot;);
  
              //End of Protype Switch Statement               
          }
  
          //End of while loop              
      }
      //End of Proinfo()    
  }
  </code></pre>