C++ program is giving a too many arguments warning

后端 未结 2 900
故里飘歌
故里飘歌 2021-01-29 16:15

I barely know what I\'m doing, I have this code where I try to solve some simple math:

 #include
 #include
 #include

        
2条回答
  •  攒了一身酷
    2021-01-29 17:18

    The compiler is warning you that you forgot to specify the field for sum in the format string. You probably wanted:

    printf("\n sum is: %d",sum);
    

    As above, it will not print the sum, and the sum value will not be used. Hence the warning.

提交回复
热议问题