Is empty case of switch in C# combined with the next non-empty one? -
with following code:
case "getsites": case "sitesetup": messagebox.show("help! suffering air-conditioned nightmare!!!"); // ... will messagebox.show executed either switch value "getsites" or "sitesetup"?
or only if switch value "sitesetup"?
since "getsites" has no break, i'm thinking yes, not sure.
update
i guess way should have worded question as:
are these 2 code fragments semantically equivalent?
fragment 1
case 0: case 1: // bla bla bla; break;fragment 2(pseudo code)
case 0, 1: // bla bla bla; break;
what describing having 2 labels same case. c# allow this. cannot, however, fall through next case statement in same way c allows, is, label cannot have code, fall through next case statement. forbidden , cause compilation error.
Comments
Post a Comment