Skip to content

Instantly share code, notes, and snippets.

@WPDC
Last active December 14, 2015 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WPDC/c88f66b994154dabc863 to your computer and use it in GitHub Desktop.
Save WPDC/c88f66b994154dabc863 to your computer and use it in GitHub Desktop.
CS0110 3.4 Anatomy of switch/case
switch ( expression ) // expression's value is matched to each of the case statements.
case value1: // If the expression matches this value, then do this block of code.
// do something
break // stop and jump out of the switch
case value2:
// do something
break
case value3:
// do something
break
default: // "else" catch all code block If none of the others match, then do this one.
// do something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment