Review the language documentation for the switch statement.
This is a sample of the correct usage:
enum RequestAction {Play, Options, Help};
int variable = Play;
switch (variable)
{
case Play:
{
// Do something.
break;
}
case Options:
{
// Do something else.
break;
}
case Help:
{
// Do something else.
break;
}
default:
{
// Do something when variable is not Play, Options or Help.
break;
}
}
0 comments:
Post a Comment