hello.c #include <stdio.h> #include "2.c" //引用test.c extern void printLine() //这里定义的方法对吗? { printf("**************\n"); } int main() { say(); return 0; } test.c #include <stdio.h> void say(){ printLine(); printf("I love imooc\n"); printf("good good study!\n"); printf("day day up!\n"); printLine(); }
=-=
应该是被调用的函数加extern