General practice to specify a break after a default clause? [duplicate]
Possible Duplicate:
break in a case with return.. and for default
If I have a switch statement:
switch()
{
case 1: ...
case 2: ...
...
default:
break;
}
Is there any reason for the break in the default clause? I see this in quite a few places, but isn't it unnecessary? What is the general practice?
Can another case label come after the default clause?
Can another case label come after the default clause?
Yes, you are allowed to place the default clause anywhere within the switch block.
精彩评论