0

Is it possible for a switch case to be nested with another switch case in C Language

case 1: case1: break; case 2: break; break; case 2: case 1: break; case 2: break; break;

2nd Aug 2018, 1:29 AM
Kelvin
Kelvin - avatar
1 Antwort
0
Yes. it is possible. But it is a bad practice. You should try to refactor it. For example, you can use array or dictionary, which will store values and will return data or invoke functions without inner switch.
7th Feb 2023, 8:48 PM
Oleksandr Gorlinskyi
Oleksandr  Gorlinskyi - avatar