Linux终端上的Hello.c错误(C语言)

时间:2018-04-12 03:51:23

标签: c linux terminal

我输入终端:

[File: hello/hello.c]
#include <stdio.h>
int main()
{
     printf("Hello World\n");
     return (0);
}

终端踢了两个错误:

     hello.c:1:1: error: expected identifier or ‘(’ before ‘[’ token
     [File: hello/hello.c]
     ^
     hello.c:2:19: fatal error: stdio.h: No such file or directory
     compilation terminated.

我想澄清一下我在这里做错了什么。提前谢谢。

1 个答案:

答案 0 :(得分:1)

[File: hello/hello.c] 应放在顶层。 只需删除或评论即可。