Skip to content

Instantly share code, notes, and snippets.

Last active Dec 14, 2015
What would you like to do?
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
case value3:
// do something
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