问答详情
源自:5-8 递归函数(二)

输出没错,这是warning怎么处理?

hello.c: In function 'getPeachNumber':
hello.c:4:5: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
 int getPeachNumber(n)


提问者:Jasper_zyt 2020-07-13 14:31

个回答

  • 慕前端7036615
    2020-07-14 21:58:55
    已采纳

    int getPeachNumber(n)改成int getPeachNumber( int n)试试

  • 慕容5401208
    2020-07-23 17:25:52

    你好。c:在函数“getPeachNumber”中:


    你好。c:2:5:警告:“n”的类型默认为“int”[-Wimplicit int]


    int getPeachNumber(n)   意思就是n没有定义数据类型  默认是int