No. switch statements only work on integral values or what can be considered an integral value. Which a string isn't.
Use if statements instead. Or a more complex system.
In C++: Can a switch statement be used on strings?
Nope.
The type of the switch expression must be an integral type or convertible to an integral type.
blazing star
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment