switch | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

switch

is any limitation in switch in c++ i mean, can use switch for any data type (for example, string)? why i'm asking? because of this: error: switch quantity not an integer

26th Nov 2018, 10:51 AM
Abolhasan Ashori
Abolhasan Ashori - avatar
1 ответ
+ 8
You can use with integral types or enumerated types. Remember the expression passed in switch need to result in a constant.
26th Nov 2018, 11:10 AM
Anya
Anya - avatar