C#... I assume it's similar in C++. If not, blow me.
switch (variable)
{
.....case: possibleValue1
..........//Do Stuff Here
..........break;
.....case: possibleValue2
..........//Do diffrent stuff here
..........break;
}
break tells the code to exit the switch command. If you don't use break, the code will run down the line. So if possibleValue1 passes, it'll execute all that code. If there is no break, it'll move on to possibleValue2. If that's true, it'll execute it's code as well.
You could use this if you want the same code to run for the first three solutions.
IE:
switch(variable)
{
case 1:
case 2:
case 3:
//Code
break;
case 4:
//code
break;
case 5:
case 6:
//code
break;
}
Lazy response. Hope that helps.