how come while loop skips char?
<p>So I'm trying to set a while loop to keep asking (y/n), but how come when I press 'y' and enter it skips "char itemtitle" and goes straight down to "double itemprice"? I'm really new to c++, please help, i'd apprreciate it</p>

<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;sstream&gt;

using namespace std;

#define tax 9.99
#define shipping ("Free")

void printmessage ()
{
  cout &lt;&lt; "*Thanks for your business! We'll ship out your item as soon as possible*\n"
              "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n";
}

int main(int argc, char** argv)
{

   cout &lt;&lt; "Write an invoice program and print it to the console.\n";
   cout &lt;&lt; "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n;

   cout &lt;&lt; "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
           "Welcome to my Pc Store.\n"
           "'Where Technology is served right'\n"
           "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"&lt;&lt; endl;

   char name [256];
   cout &lt;&lt; "Enter your full name: ";
   cin.getline (name, 256);

   char organization [256];
   cout &lt;&lt; "What's your organization?: ";
   cin.getline (organization, 256);

   char quit = 'y';    
   do {
        char itemtitle [256];
        cout &lt;&lt; "Enter name of Laptop you'd like to order: ";
        cin.getline (itemtitle, 256);

        double itemprice;
        cout &lt;&lt; "Enter price of item: $";
        cin &gt;&gt; itemprice; 

        int quantity;
        quantity = 1;
        cout &lt;&lt; "How many items?: ";
        cin &gt;&gt; quantity;

        if (quantity == 1) {     
            cout &lt;&lt; "1 item(s)\n";  
        } else  {
           cout &lt;&lt; quantity &lt;&lt; " item(s)\n";
        } 

        cout &lt;&lt; "Tax: $" &lt;&lt; tax;

        double subtotal;
        subtotal = quantity * itemprice + tax;
        cout &lt;&lt; "\nSub Total: $" &lt;&lt; subtotal;

        cout &lt;&lt; "\n";       
        cout &lt;&lt; "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"
               "Validation:\n\n";

        cout &lt;&lt; "Item(s):\t\t\t\t\t" &lt;&lt; "Amount:\n";       
        cout &lt;&lt; itemtitle &lt;&lt; "\t\t\t\t\t$" &lt;&lt; quantity * itemprice + tax; ;
        cout &lt;&lt; "\n" &lt;&lt; quantity &lt;&lt; " * $" &lt;&lt; itemprice &lt;&lt; " + $" &lt;&lt; tax;

        cout &lt;&lt; "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n";
        cout &lt;&lt; "Payment (Credit/Debit only)!\n\n";

        double cardnum;
        cout &lt;&lt; "Card Numbers: ";
        cin &gt;&gt; cardnum;

        int ssn;
        cout &lt;&lt; "SSN: ";
        cin &gt;&gt; ssn;

        cout &lt;&lt; "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
               "Invoice Details:\n\n";

        time_t rawtime;
        struct tm * timeinfo;
        time ( &amp;rawtime );
        timeinfo = localtime ( &amp;rawtime );
        cout &lt;&lt; "Date&amp;Time: " &lt;&lt; ("Current local time and date: %s", asctime (timeinfo));

        cout &lt;&lt; name;
        cout &lt;&lt; "\n" &lt;&lt; organization;
        cout &lt;&lt; "\n" &lt;&lt; "("&lt;&lt; quantity &lt;&lt; ")" &lt;&lt; " " &lt;&lt; itemtitle;

        cout &lt;&lt; "\n\t\t\t" &lt;&lt; "Total: $" &lt;&lt; quantity * itemprice;
        cout &lt;&lt; "\n\t\t\t" &lt;&lt; "Tax: $" &lt;&lt; tax;
        cout &lt;&lt; "\n\t\t\t" &lt;&lt; "Shipping: " &lt;&lt; shipping;
        cout &lt;&lt; "\n\n\t\t\t" &lt;&lt; "Balance Due: $" &lt;&lt; quantity * itemprice + tax;

        cout &lt;&lt; "\n\t\t\t" &lt;&lt; "Payment: " &lt;&lt; "Paid" ;

        cout &lt;&lt; "\n\n\nDo you want to continue shopping? (y/n): ";
        cin &gt;&gt; quit ;

        cout &lt;&lt; "\n\n";

    } while (quit != 'n');

    cout &lt;&lt; "\n\n\n";
    printmessage ();

    return 0;
}
</code></pre>
