Compiling the following code and got the error of type illegal.
type illegal
int main() { // Compilation error - switch expression of type illegal sw
In C++ and C switches only work on integer types. Use an if else ladder instead. C++ could obviously have implemented some sort of swich statement for strings - I guess nobody thought it worthwhile, and I agree with them.