按答案寫,為啥運(yùn)行失敗?
#include <stdio.h>
#include "test.c"?? //引用test.c文件
extern void printLine()???? //這里定義的方法對嗎?
{
?? printf("**************\n");? ?
}
int main()
{
??? say();
??? return 0;
}
#include <stdio.h>
#include "test.c"?? //引用test.c文件
extern void printLine()???? //這里定義的方法對嗎?
{
?? printf("**************\n");? ?
}
int main()
{
??? say();
??? return 0;
}
2018-05-13
舉報(bào)
2018-07-10
還是不對啊,和答案一摸一樣都不對
2018-07-05
是可以直接調(diào)用,但得把#test.c注釋掉
2018-05-19
我就奇怪了,為什么還要調(diào)用回來呀一次呀,,在main函數(shù)中調(diào)用say()不就代表從文件test.c中調(diào)用的嗎?在test.c文件中say()函數(shù)難道不是被默認(rèn)為extern型的函數(shù)了嗎?hello.c文件相對于test.c文件就是外部文件呀!所以直接調(diào)用不就可以了嗎?為什么錯(cuò)誤呀??大神求解
2018-05-14
#include <stdio.h>
#include "test.c"?? //引用test.c文件
extern void printLine()???? //這里定義的方法對嗎?
{
?? printf("**************\n");? ?
}
extern void say();
int main()
{
??? say();
??? return 0;
}
你應(yīng)該沒看到另一個(gè)文件,而且你還缺省了一個(gè)函數(shù)的調(diào)用