I have the following switch
with a break
without a case
:
char c = 'a';
switch(c) {
break;
case 'a' : cout << 'a' << endl;
break;
case 'b' : cout << 'b' << endl;
break;
default : break;
}
Why does this code snippet print a
? Shoudn't the switch break after encountering the first break
statement only?