The idea behind the switch is that the compiler can create code that only validates the switch expression at runtime and thereby outputs the location for the jump.
If the case label could be an expression that is not a constant, it would have to evaluate all such case expressions to see if there is one. Therefore, instead of evaluating one expression, he would have to evaluate expressions n , where n is the number of case labels for this switch .
The whole idea of switch is to do it the other way around than you. Put the variable expression a in the switch itself and put in it constants like your 'c' .
Jens gustedt
source share