C/C++ switch...Caseで変数を迂回して初期化
518 ワード
:
1. switch ,
Code:
switch (num)
{
case 1:
int n=3; break; //fault
case 2:
//....
}
switch (num)
{
case 1:
{
int n=3; //right
break;
}
}
2.goto ,
Code:
if (i<j)
goto max; //fault
int crazy = 4;
max:
//....
テキストリンク:http://blog.csdn.net/crazyjixiang/article/details/6492351