Visual C++ .NET/Statement/switch
Create a switch Statement
<source lang="csharp">
- include "stdafx.h"
- using <mscorlib.dll>
using namespace System; int main(void) {
int x = 2; switch (x) { case 1: Console::WriteLine("Case 1"); break; case 5: case 6: Console::WriteLine("Case 5 or 6"); break; default: Console::WriteLine("Default case"); } return 0;
}
</source>