Compiling the following code and got the error of type illegal.
type illegal
int main() { // Compilation error - switch expression of type illegal sw
Switches only work with integral types (int, char, bool, etc.). Why not use a map to pair a string with a number and then use that number with the switch?