c语言的label后面不能直接跟变量申明
int x = 5; goto JUMP; printf("x is : %d\n",x); JUMP: int a = 0; <=== 错误,lable后面不能申明变量,只能是表达式语句(statement),哪怕是空语句.. printf("%d",a);
int x = 5; goto JUMP; printf("x is : %d\n",x); JUMP: ; /// 空语句,正确 int a = 0; // 前面有空语句,正确 printf("%d",a);
label只在函数内有效
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
支付宝扫一扫捐赠
支付宝扫一扫捐赠
微信公众号: 共鸣圈
欢迎讨论,邮件: 924948$qq.com 请把$改成@
QQ群:263132197
QQ: 924948