switch for string | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

switch for string

can someone suggest a good method to use switch for strings

5th Mar 2018, 4:09 PM
shaiju kumar
shaiju kumar - avatar
1 Resposta
+ 12
U can't use string in switch i will suggest u to go for character.... instead well u can do like this...: if the case values have different 1st alphabet like choices between apple , banana, mango.... switch (choices){ case 'a': cout<<"apple"; case...... ......... ........etc } check out this šŸ‘‡ https://stackoverflow.com/questions/9856310/switch-statement-with-strings
5th Mar 2018, 5:08 PM
šŸŒ›DTšŸŒœ
šŸŒ›DTšŸŒœ - avatar