首页 > 其他 > 详细

c 编译异常 switch 之a label can only be part of a statement and a declaration is not a statement

时间:2015-03-03 18:28:52      阅读:1607      评论:0      收藏:0      [点我收藏+]

client.c:996: error: a label can only be part of a statement and a declaration is not a statement

switch(a){
case 1:
....................
....................
....................
break;
case 2:
break;
}
 
在GCC下编译会出现如下错误:
error: a label can only be part of a statement and a declaration is not a statement
但加上如下括号后,就没有错误了,这是为什么?编译器的问题?
switch(a){
case 1:

....................
....................
....................

break;
case 2:
break;
}
http://zhidao.baidu.com/link?url=fSrpX7VaVXd5-L8c2zj2xVDSbh8bM-5xyO6iyZOYgV30mI_iZlASQmNakmGSC-4gnPO3oG2HzIAvdSVayOTjTa
http://www.cnblogs.com/radiolover/p/4307453.html 手机定位
http://www.cnblogs.com/skyme/p/4310550.html 数据挖掘

c 编译异常 switch 之a label can only be part of a statement and a declaration is not a statement

原文:http://www.cnblogs.com/pengkunfan/p/4311613.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!