Can be use characters in switch statement? Can you please explain this with the help of an example in C++ ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can be use characters in switch statement? Can you please explain this with the help of an example in C++ ?

20th May 2019, 1:40 AM
Anuj Raghu
Anuj Raghu - avatar
1 Answer
+ 2
Char is an integral type so you can use it in switch An example would be.. char a = 'a'; a++; // or a= a+1; cout<< a; // output b or.. char xxx = 65; cout<< xxx; // output 65?
20th May 2019, 11:05 PM
AZTECCO
AZTECCO - avatar