Presumably because switch
functions like a goto
- if a == 1
, it jumps straight to case 1:
and bypasses initialization of b
.
That is: I know switch
jumps straight to the case
label, but I'm very surprised the compiler doesn't complain about the missed initialization.