When the following code is compiled, the following error message appears:
Enter illegal.
int main()
{
// Compilation error - switch expression of type illegal
switch(std::string("raj"))
{
case"sda":
}
}
String cannot be used in either switch or case.
Why?
Is there a good way for supporting logic comparable to switch on strings?