0

Can switch statement use for string?

8th Nov 2017, 5:24 AM
joelio alex
joelio alex - avatar
3 Respostas
+ 15
Not for C++. There is a workaround using enum, but that's not always what you want. https://stackoverflow.com/questions/650162/why-switch-statement-cannot-be-applied-on-strings
8th Nov 2017, 5:33 AM
Hatsy Rei
Hatsy Rei - avatar
+ 7
Yes it could.
8th Nov 2017, 5:27 AM
qwerty
qwerty - avatar
+ 1
nice
8th Nov 2017, 5:41 AM
joelio alex
joelio alex - avatar