我正在尝试一点 C。我以为我已经理解了这个链接业务。但我想不会。我有一个简单的文件 main.c:
#include "function.h"
int main(char args[])
{
int print = myfunction();
}
然后是第二对文件 function.c/function.h
int myfunction(); //function.h
int myfunction() //function.c
{
return 5;
}
编译这个效果很好。但是,无论我是否#include "function.h"
在我的主文件中使用,它都很好用。那为什么我需要包含 function.h 呢?