什么出口(10); C语言程序意味着什么? [英] what does exit(10); mean in C language program?

查看:63
本文介绍了什么出口(10); C语言程序意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

推荐答案

表示退出程序并将值10返回给操作系统作为程序结果。

10可能意味着操作系统依赖于具有已定义含义的唯一数字是0,必须将其解释为成功。通常,任何非零数字都会以某种方式被解释为失败。
it means exit the program and return a value of 10 to the operating system as the programs result.

What 10 might mean is operating system dependant the only number with a defined meaning is 0 which must be interpreted as success. Normally any non-zero number is interpreted as fail in some manner.


我认为exit(10);这里没有意义且无法访问,如果程序返回0之前的情况。
I think "exit(10);" here is meaningless and unreachable, case the program return 0 before.


抱歉你说得对,我在你的标题中回答了问题而不是你帖子中的问题。


在发布的代码中, exit(10); 无法访问,因为返回0; 将首先发生。
Sorry you''re right I answered the question in your title not the question in your post.

In the posted code the exit(10); is unreachable and will never be executed because the return 0; will happen first.


这篇关于什么出口(10); C语言程序意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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