Strings and cin/out

Working on a homework problem. I've searched all over for a few hours now, and I can't figure out why it isn't working. It's probably something simple, I'm a noob. When I run the program, it's skipping my 2nd getline, It won't let the user input the data, it just skips to the next question. I have bolded the instruction that isn't showing up in my output, This is a Windows32 Console App, written in Visual Studio C++. TIA!!!!!

//get input from the user

cout << "Welcome to Handy Hardware! What is your first name? \n";
getline (cin,firstName);

cout << "How many years have you lived here " <<firstName<< "? \n";
cin >> yearsLived;

cout << "What would you like to buy today? \n";
getline (cin,itemName);

cout << "What was the advertised price of the item? \n";
cin >> origPrice;

cout << "How many would you like? \n";
cin>> itemQuantity;
cin >> ...; leaves the end of line in the stream. 'getline()' takes it and returns immediately. You don't need 'getline()' because cin >> ...; waits for enter anyway.
UGH!! Thank you sooooo much. That fixed it! It's crazy how simple it is to fix when you know what to do. I think I've spent 4 hours on this. Welcome to coding, right?
Topic archived. No new replies allowed.