warning: format ‘%d’ expects type ‘int *’, but argument 2 has type ‘int’

前端 未结 7 1778
醉话见心
醉话见心 2020-12-09 20:39

So I\'m new to C and am having trouble with whats happening with this warning. What does the warning mean and how can i fix it. The code i wrote is here:

voi         


        
7条回答
  •  Happy的楠姐
    2020-12-09 21:11

    I'm assuming its complaining about the line scanf("%d\n", age); The issue is that scan f expects a pointer to your variable not the variable. You need to get an address to variable by perpending a '&` and you should be fine.

提交回复
热议问题