KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Compiling the following code gives the error message: type illegal . int main() { // Compilation error - switch expression of type illegal switch(std::string("raj")) { case"sda": } } You cannot use string in either switch or case . Why? Is there any solution that works nicely to support logic similar to switch on strings?
Tags (comma-separated)
Save Edits
Cancel