No undefined. But the value iis only checked when the code reaches switch (i). Therefore, it case 1:will be skipped (by the operator break;).
The keyword switchdoes not mean "run code when the value iis 0/1." This means, check that iRIGHT NOW, and run the code on it. I don't care what happens iin the future.
In fact, sometimes it’s useful to do:
for( step = 0; !cancelled; ++step ) {
switch (step)
{
case 0:
break;
case 1:
break;
case 19:
return;
}
}
case ( , next_state case state = next_state ).