英文:
Why this % when printing a single value of array
问题
printf("%d", marks[0][0];
Output
90%
I was printing a 2d array and this happened
英文:
printf("%d" , marks [0][0];
Output
90%
I was printing a 2d array and this happened
答案1
得分: 4
这个%
很可能是命令提示符。
尝试使用
printf("%d\n", marks[0][0]);
以便将90
(或应该打印的任何值)显示在单独的一行上。
英文:
That %
is most likely the shell prompt.
Try using
printf("%d\n", marks[0][0]);
so that the 90
(or whatever value should be printed) is displayed on a line of its own.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论