大佬們幫我看看怎么回事啊
#include
#include "test.c" ? //引用test.c文件 extern void printLine() ? ? //這里定義的方法對(duì)嗎? { ? printf("**************\n"); ? } int main() { ? ?printLine(); ? ?say(); ? printLine(); ? ?return 0; ? ? }這樣不可以嗎#include
#include "test.c" ? //引用test.c文件 extern void printLine() ? ? //這里定義的方法對(duì)嗎? { ? printf("**************\n"); ? } int main() { ? ?printLine(); ? ?say(); ? printLine(); ? ?return 0; ? ? }這樣不可以嗎2017-11-04
舉報(bào)
2017-11-14
#include <stdio.h>
void say(); ? //引用test.c文件
extern void printLine() ? ? //這里定義的方法對(duì)嗎?
{
? ?printf("**************\n"); ??
}
int main()
{
? ? say();
? ? return 0;
}
2017-11-04
extern可以置于變量或者函數(shù)前,以表示變量或者函數(shù)的定義在別的文件中,提示編譯器遇到此變量和函數(shù)時(shí)在其他模塊中尋找其定義。另外,extern也可用來(lái)進(jìn)行鏈接指定。
static
http://www.cnblogs.com/yezhenhan/archive/2011/10/31/2229724.html