简单c语言题目(老师也不会,郁闷)

来源:百度知道 编辑:UC知道 时间:2024/05/21 15:35:28
file1.c
#include"file2.c"
void main()
{
n();
}
file2.c
void n()
{}
提示错误为(连接是出错)error LNK2001: unresolved external symbol _main
Debug/sdde.exe : fatal error LNK1120: 1 unresolved externals

没有错啊
file1.c中的程序:在这个里面编译运行
#include"file2.c"
main()
{
n();
system("pause");
return 0;
}
file2.c
void n()
{
printf("成功!\n");
}
为了看结果,我写了一个语句。
用dev C++编译器写的。vc 应该也可以。

在file1.c里加个extern void n();