How To Write Or In Switch Case
-
Hi There, I Want to know how to write or in switch case. For Example I Had written Like this case "A" || "B" || "C": Even I tried With : and also with , Can anybody tell me how to do this. Thanks.
switch(something)
{
case A:
case B:
case C:
DoSomething():
break;
case D:
DoSomethingELse();
break;
case E:
DoOtherThings();
goto case D;
default:
DoDefault();
break;
}The first case A,B and C is OR, Case E is and and between E and D. http://msdn.microsoft.com/en-us/library/06tc147t(VS.71).aspx[^]
Yusuf May I help you?
-
switch(something)
{
case A:
case B:
case C:
DoSomething():
break;
case D:
DoSomethingELse();
break;
case E:
DoOtherThings();
goto case D;
default:
DoDefault();
break;
}The first case A,B and C is OR, Case E is and and between E and D. http://msdn.microsoft.com/en-us/library/06tc147t(VS.71).aspx[^]
Yusuf May I help you?