#include <iostream> using namespace std; #include <string> int quizshow() { int a; cout<<"Select a category by pressing its corresponding number"<<endl; cin>>a; switch(a) { case 1: string a; { cout <<"What is a comma used after th"; cout <<endl; cin>>a; if (a == "Oxford comma") { cout <<"You are winner"; } else cout <<"You are loser"; } } } int main() { quizshow(); }
getline
//cin>>a; // Comment out or delete your current input cin.ignore(10000,'\n'); // 'Empty' input getline(cin, a);
std::numeric_limits<std::streamsize>::max()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)