argv[argc] ==?

。_饼干妹妹 提交于 2019-11-26 09:46:34

问题


My professor and a couple of students are arguing about whether argv is null terminated or not. My friend wrote a small program and it printed out null but another kid said that he is probably simply reading into blank memory. Can someone solve this discussion?


回答1:


From the Standard:

5.1.2.2.1 Program startup
...
-- argv[argc] shall be a null pointer.

So, yes; argv is null terminated




回答2:


According to the standard, "argv[argc] shall be a null pointer" (5.1.2.2.1).



来源:https://stackoverflow.com/questions/3772796/argvargc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!