+ 1
Switch (string)
can you have a switch having a string as it's value
3 Answers
0
Of course, you can do this:
switch (<string variable>) {
case "anything": <statement>
}
At least in java and c i believe you can.
0
i think it is not possible in C the only types you can use are int and char
0
You're right, forgot about that. But tecnically a char pointer is a string since it's kept on a read-only zone in the memory so perhaps it's possible.