Tuesday, August 4, 2009

What’s different about switch statements in C#?

C# does not support an explicit fall through from one case label to another. If you want, you can use goto a switch-case or goto default.

case 1:
cost += 5;
break;
case 2:
cost += 10;
goto case 1;

No comments: