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

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -