分页: 1 / 1

求救:expected identifier or ‘(’ before numeric constant

发表于 : 2012-02-27 12:44
watson爱好者
:em19 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
太奇怪了。
请帮助,谢谢

Re: 求救:expected identifier or ‘(’ before numeric constant

发表于 : 2012-02-27 13:14
watson爱好者
有遇到过同样问题的吗?

Re: 求救:expected identifier or ‘(’ before numeric constant

发表于 : 2012-02-27 14:42
mjp123
吧你的代码复制过来。没有任何问题。

Re: 求救:expected identifier or ‘(’ before numeric constant

发表于 : 2012-02-27 15:40
watson爱好者
mjp123 写了:吧你的代码复制过来。没有任何问题。
难道是我的ubuntu的问题?

Re: 求救:expected identifier or ‘(’ before numeric constant

发表于 : 2012-02-27 19:29
nopriler
首先,请使用code标签。

代码: 全选

#include<stdio.h>
int main(void){
	printf("Hello, world!\n");
	return 0;
}
我怀疑是stdio.h 被改动了..看一下stdio.h第30行上下的内容。