default
case should always occur at last in a switch
statement CS-R1121The default
case in a switch
statement specifies the logic to execute when no provided cases match the input. Ideally it should be placed at last as it specifies what to do as a "last" resort. Therefore, consider placing it appropriately.
switch (i)
{
default:
// ...
break;
// rest of the cases
}
switch (i)
{
// cases
default:
// ...
break;
}