main.c: In function ‘hello’: main.c:3:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ bef

具体错误:
main.c: In function ‘hello’:
main.c:3:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
{
^
main.c:6:1: error: expected ‘{’ at end of input
}
^

三个程序:

程序1 hello.h
  #ifndef HELLO_H
    #define HELLO_H
   void hello(const char *name);
	#endif //HELLO_H
程序2: hello.c
#include 
void hello(const char *name)
{ 
printf("Hello %s!/n", name);
}
程序3: main.c
#include "hello.h"
int main()
{
hello("everyone");
return 0;
}

转载连接:https://blog.csdn.net/zjjyliuweijie/article/details/6322483

程序2中,少些了一个“;”
就报错了。

你可能感兴趣的:(编译)