argv[argc] ==? [英] argv[argc] ==?

查看:39
本文介绍了argv[argc] ==?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的教授和几个学生正在争论 argv 是否以 null 结尾.我的朋友写了一个小程序,它打印出 null 但另一个孩子说他可能只是在读入空白内存.有人能解决这个讨论吗?

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?

推荐答案

来自标准:

5.1.2.2.1 程序启动
...
-- argv[argc] 应为空指针.

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

所以,是的;argv 为空终止

So, yes; argv is null terminated

这篇关于argv[argc] ==?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆