You can't define a variable inside a switch statement. Define that int outside first and then assign it a value inside the switch.
Actually, you can, if the variable is defined in a block. That is why each case starts and ends with { and },
You can't define a variable inside a switch statement. Define that int outside first and then assign it a value inside the switch.
Actually, you can, if the variable is defined in a block. That is why each case starts and ends with { and },