B
Benny Raymond
I'm confused as to how fallthrough is limited in switch. For example
the following works:
string switch_test = "a";
switch (switch_test)
{
case "a":
case "b":
case "c":
doSomething(a);
break;
}
but the following does not work:
string switch_test = "a";
switch (switch_test)
{
case "a":
if (<some test>)
break;
case "b":
case "c":
doSomething(a);
}
why is that?
the following works:
string switch_test = "a";
switch (switch_test)
{
case "a":
case "b":
case "c":
doSomething(a);
break;
}
but the following does not work:
string switch_test = "a";
switch (switch_test)
{
case "a":
if (<some test>)
break;
case "b":
case "c":
doSomething(a);
}
why is that?