GCC:
error: a label can only be part of a statement and a declaration is not a statement
switch(a){ swtch(a){
case 1: case 1:
.................... {
.................... ...............
.................... ...............
break; ................
case 2: }
break; break;
} case 2:
break;
}
Error OK
追问
找到了原因,我在case下面定义了变量,并给它赋了初值,当把定义和赋值分开就好了,或者是加上大括号。