I have some cases in a switch statement sharing common code. Would this work?
Code:switch(mycase){ case 0: { code for case 0; } break; case 1: case 2: { common code for case 1 and 2; } break; case 2: { code only for case 2; } break; }
CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
Results 1 to 9 of 9
Thread: switch with repeating cases?Threaded View
|
Click Here to Expand Forum to Full Width |