简体   繁体   English

argv [argc] ==?

[英]argv[argc] ==?

My professor and a couple of students are arguing about whether argv is null terminated or not. 我的教授和几个学生正在争论argv是否被终止。 My friend wrote a small program and it printed out null but another kid said that he is probably simply reading into blank memory. 我的朋友写了一个小程序,它打印出null但另一个孩子说他可能只是在阅读空白记忆。 Can someone solve this discussion? 有人能解决这个问题吗?

From the Standard: 从标准:

5.1.2.2.1 Program startup 5.1.2.2.1程序启动
... ...
-- argv[argc] shall be a null pointer. - argv [argc]应为空指针。

So, yes; 所以,是的; argv is null terminated argv以null结尾

根据标准,“argv [argc]应为空指针”(5.1.2.2.1)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM