Another question by me!
How can I use a Char in a switch()?
I tried it like this:
But I get an error message saying:" case label "A" does not reduce to an integer constant "Code:char x[2]; cout<<"Write A or B"; cin>>x; switch((char)x); { case("A"): cout<<"You wrote <<x<<"!"; break; case("B"): cout<<"You wrote <<x<<"!"; break; default: cout<<"Bad input!"; }
I know it's easy to fix.. but how?