+ 1
Can a string be used instead of int in c++?
In a switch loop.... can I use a string as a switch instead of int? If yes, how to do that?
1 ответ
+ 6
Unfortunately, switch statements in C++ does not allow the use of string as case. Int and char are possible, but not string. You will have to utilise if... else statements to proceed with string. I have had similar issues in the past.