關于我在say函數加了一個static卻可以過
這是hello.c的文件
#include <stdio.h>
#include "test.c"? ?//引用test.c文件
extern void printLine()? ? ?//這里定義的方法對嗎?
{
? ?printf("**************\n");? ?
}
int main()
{
? ? say();
? ? return 0;
}
這個是text.c的文件
#include <stdio.h>
static void say(){
? ? printLine();
? ? printf("I love imooc\n");
? ? printf("good good study!\n");
? ? printf("day day up!\n");
? ? printLine();
}
按他講的我給say加一個static, 不是應該hello.c也無法引用嗎,
為啥這個可以過
2019-10-05
#include "test.c"作用就是被引入到hello.c,引入進去相當與hello.c的一部分,所以將say()改為static,調用內部函數。懂了不哥們