Does switch case work with Strings 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  How do you end a while loop in a switch case?

Leave a Reply

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

Does switch case work with strings in C#?

The C# language allows you to switch on a string variable . The switch statement compares the String objects in its expression with the expressions associated with each case label as if it were using the String.

Sizin İçin Seçtik  Can you use equals in Java?

Leave a Reply

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