cout << "Enter the number: "; int number; cin >> number; cin.ignore(256, ' '); // remaining input characters up to the next newline character // are ignored cout << "Enter names: "; string names; getline(cin, names);
2.1m questions
2.1m answers
60 comments
57.0k users