gcc是不是出错了
hello world文件
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}
然后保存到hello.c
再gcc hello.c
结果就出现了
hello.c:30:1: 错误: expected identifier or ‘(’ before numeric constant
太奇怪了。
请帮助,谢谢
求救:expected identifier or ‘(’ before numeric constant
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 18
- 注册时间: 2012-02-26 14:05
-
- 帖子: 18
- 注册时间: 2012-02-26 14:05
- mjp123
- 帖子: 702
- 注册时间: 2009-04-09 15:06
Re: 求救:expected identifier or ‘(’ before numeric constant
吧你的代码复制过来。没有任何问题。
-
- 帖子: 18
- 注册时间: 2012-02-26 14:05
Re: 求救:expected identifier or ‘(’ before numeric constant
难道是我的ubuntu的问题?mjp123 写了:吧你的代码复制过来。没有任何问题。
-
- 帖子: 352
- 注册时间: 2011-01-23 15:05
Re: 求救:expected identifier or ‘(’ before numeric constant
首先,请使用code标签。
我怀疑是stdio.h 被改动了..看一下stdio.h第30行上下的内容。
代码: 全选
#include<stdio.h>
int main(void){
printf("Hello, world!\n");
return 0;
}