Thursday, August 9, 2007

Switch Statement in C# .net

Switch Statement syntax in C# .NET

switch (expression)
{
case constant-expression:
statement
jump-statement
[default:
statement
jump-statement]
}

 


An example is here...

switch (i) {
case 0:
CaseZero();
goto case 1;
case 1:
CaseZeroOrOne();
goto default;
default:
CaseAny();
break;
}
That's pretty simple C# syntax for Switch-case statements.

Technorati Tags:

No comments:

 
Dotster Domain Registration Special Offer