5.13的任務(wù)怎么搞
小編把代碼編輯器中的某個(gè)方法定義錯(cuò)了,你能幫他改正嗎?
在代碼編輯器中:
第3行將函數(shù)改為外部函數(shù)
運(yùn)行結(jié)果為
hello.ctest.c
#include <stdio.h>
#include "test.c"?? //引用test.c文件
static void printLine()???? //這里定義的方法對(duì)嗎?
{
?? printf("**************\n");??
}
int main()
{
??? say();
??? return 0;
}
2019-03-28
test.c怎么寫(xiě)啊
2017-08-09
C語(yǔ)言規(guī)定,在沒(méi)有指定函數(shù)的作用范圍時(shí),系統(tǒng)會(huì)默認(rèn)認(rèn)為是外部函數(shù),因此當(dāng)需要定義外部函數(shù)時(shí)extern也可以省略,任務(wù)是要你把第三行的函數(shù)改為外部函數(shù),即定義為外部函數(shù)
#include <stdio.h>
#include "test.c" ? //引用test.c文件
extern ?void printLine() ? ? //用extern
{
? ?printf("**************\n"); ??
}
int main()
{
? ? say();
? ? return 0;
}