c语言的label后面不能直接跟变量申明

    int x = ;
goto JUMP;
printf("x is : %d\n",x);
JUMP:
int a = ; <=== 错误,lable后面不能申明变量,只能是表达式语句(statement),哪怕是空语句..
printf("%d",a);
    int x = ;
goto JUMP;
printf("x is : %d\n",x);
JUMP: ; /// 空语句,正确
int a = ; // 前面有空语句,正确
printf("%d",a);

label只在函数内有效

上一篇:0952. Largest Component Size by Common Factor (H)


下一篇:固定长度的队列limitArray