5 AnswersNew Answer
You're missing closing curly brace (}) of the body of a switch statement. C++ Switch Statements Use the switch statement to select one of many code blocks to be executed. https://www.w3schools.com/cpp/cpp_switch.asp This is how it works: The switch expression is evaluated once The value of the expression is compared with the values of each case If there is a match, the associated block of code is executed The break and default keywords are optional
// Hope this link helps you https://stackoverflow.com/questions/16388510/evaluate-a-string-with-a-switch-in-c
Does this mean that the switch does not work with the string?
Ramadan, that's right. C++ switch statement cannot accept string as evaluation subject. However we can create our own function to achieve somewhat similar result. https://code.sololearn.com/cCqd6prmLX9M/?ref=app
No, there is another error