第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

請教下各位大神,這是什么原因造成的?


代碼(code):

#include <stdio.h>



int main()

{

int a1=32;

int a2=51;

int maxNum=max(a1,a2);

printf("the max value is %d",maxNum);

return 0;

}



錯誤報(bào)告(error report):

trugle@strugle-virtual-machine:~/workspace/les1/les2$ gcc max.c hello.c o- main.out

hello.c: In function ‘main’:

hello.c:8:20: warning: implicit declaration of function ‘max’ [-Wimplicit-function-declaration]

? ? 8 |? ? ? ? ?int maxNum=max(a1,a2);

? ? ? |? ? ? ? ? ? ? ? ? ? ^~~

gcc: error: -E or -x required when input is from standard input


正在回答

2 回答

//?定義max.c源文件,以下是文件內(nèi)容
int?max(int?a,?int?b)?{
????return?a?>?b???a?:?b;
}
//?定義max.h頭文件,文件內(nèi)容
int?max(int,?int);
//?在main函數(shù)所在文件中,要加入#include?"max.h",而且要和main文件在一個文件夾內(nèi)
//?編譯文件gcc?-c?max.c?-o?max.o
//?生成最終文件gcc?max.o?main.c?-o?main.out
//?main.c就是包含main函數(shù)的文件,可以根據(jù)自己命名文件來修改
//?講課視頻中不出現(xiàn)編譯問題,就是因?yàn)榫幾g器不同造成的
0 回復(fù) 有任何疑惑可以回復(fù)我~

你的max函數(shù)沒有聲明,可以選擇在main函數(shù)之前把max寫上,或者在頭文件里引用max.c或者編譯后的max.h

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

請教下各位大神,這是什么原因造成的?

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號