Can we use string in switch case in C++?

You cannot use string in either switch or case .

Sizin İçin Seçtik  Can we use while loop in switch-case?

Leave a Reply

Your email address will not be published. Required fields are marked *

Can we use string in switch case in C?

No you can’t . The case labels of a switch need to be compile time evaluable constant expressions with an integral type.

Sizin İçin Seçtik  Hangi hastalığa yüzde kaç özürlü raporu verilir?

Leave a Reply

Your email address will not be published. Required fields are marked *