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

前端 未结 7 1790
醉话见心
醉话见心 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条回答
  •  孤城傲影
    2020-12-09 20:58

    You should write scanf("%d", &age), as the scanf function needs to modify the value of age, hence the need to pass it "by address" and not "by value".

提交回复
热议问题