Are you able to have multi-character switch statement cases?
So if this is my code:
#include <iostream>
using namespace std;
int main(){
char choice;
cout << "Enter a word >" << endl;
cin >> choice;
switch (choice) {
case 'ball':
cout << "You entered ball" << endl;
break;
case 'bike':
cout << "You entered bike" << endl;
break;
}
}
Am I able to run it? If so, will it work?
I actually am trying to run this code, but I can't. It will run, but then if I type in bike, it won't display "You entered bike". Is something wrong with the code?