0
How do I use switch with a string instead of an interger
4 Antworten
+ 1
It depends on what language. Which are you using?
0
it's the same syntax
0
Using a string variable and enclosing the cases in quotes...
string var = "hello";
switch (var) {
case "hello":
break;
case "world":
break;
}
0
J.G. c++ the value of the string is input by the user