函數(shù)未定義問題
hello.c: In function ‘main’: hello.c:9:13: warning: implicit declaration of function ‘max’ [-Wimplicit-function-declaration] ?int maxNum=max(a1,a2); ? ? ? ? ? ? ^ 每一步都按照視頻走,怎么會(huì)出現(xiàn)這個(gè)問題?
hello.c: In function ‘main’: hello.c:9:13: warning: implicit declaration of function ‘max’ [-Wimplicit-function-declaration] ?int maxNum=max(a1,a2); ? ? ? ? ? ? ^ 每一步都按照視頻走,怎么會(huì)出現(xiàn)這個(gè)問題?
2017-03-15
舉報(bào)
2017-05-18
在主程序中加一句申明 ? :int max (int a,int b);
2017-03-16
編譯器不同結(jié)果會(huì)不同,這個(gè)是沒聲明,有的版本編譯器可以自動(dòng)優(yōu)化這個(gè)問題所以不會(huì)提出warning??梢栽趍ain 函數(shù)上加max函數(shù)的聲明。