Why does getline not result in the text I expected? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Need help with getline() In the following code, my getline is skipped entirely and doesn't prompt for input. #include <cstdlib> #include <iostream> #include <iomanip> #include <string> #include <istream> using namespace std; int main () { int UserTicket[8]; int WinningNums[8]; char options; string userName; cout << "LITTLETON CITY LOTTO MODEL: " << endl; cout << "---------------------------" << endl; cout << "1)