0

How do I use switch with a string instead of an interger

5th Aug 2018, 12:15 PM
Mumba Mwape
Mumba Mwape - avatar
4 odpowiedzi
+ 1
It depends on what language. Which are you using?
5th Aug 2018, 1:19 PM
J.G.
J.G. - avatar
0
it's the same syntax
5th Aug 2018, 12:20 PM
hinanawi
hinanawi - avatar
0
Using a string variable and enclosing the cases in quotes... string var = "hello"; switch (var) { case "hello": break; case "world": break; }
5th Aug 2018, 12:21 PM
TurtleShell
TurtleShell - avatar
0
J.G. c++ the value of the string is input by the user
5th Aug 2018, 1:29 PM
Mumba Mwape
Mumba Mwape - avatar