【发布时间】:2014-08-18 00:03:30
【问题描述】:
为什么除非我删除评论,否则代码不起作用?
#include <stdio.h>
int main(){
int num = 5;
switch(num){
case 5:
//printf("");
int another = 1;
printf("%d", num+another);
break;
}
}
gcc 返回错误:
prog.c: In function ‘main’:
prog.c:7:13: error: a label can only be part of a statement and a declaration is not a statement
谢谢。
【问题讨论】:
-
谢谢@Donal,你向我解释了。
标签: c gcc switch-statement