从主要回来 [英] return from main

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

问题描述

伙计们,


我可以从main()返回0吗?这相当于

退出(EXIT_SUCCESS)?


感谢您的帮助......

Guys,

Can I return 0, from main() ? Is this equivalent to
exit(EXIT_SUCCESS) ?

thanks for any help...

推荐答案

ju ********** @ yahoo .co.in 说:

伙计们,


我可以从main()返回0吗?
Guys,

Can I return 0, from main() ?



是。

Yes.


这相当于退出(EXIT_SUCCESS)?
Is this equivalent to exit(EXIT_SUCCESS) ?



在实践中是的。从理论上讲,EXIT_SUCCESS和0都代表成功的终止,但标准并没有禁止他们拥有不同的
值并代表不同类型的成功! (我不知道以这种方式区分它们的任何

实现,并且可能没有这样的实现。

。)


-

Richard Heathfield< http://www.cpax.org.uk>

电子邮件:-http:// www 。 + rjh @

谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>

Usenet是一个奇怪的放置" - dmr 1999年7月29日

Yes in practice. In theory, EXIT_SUCCESS and 0 both represent successful
termination but the Standard doesn''t forbid them from having different
values and representing different kinds of success! (I don''t know of any
implementations that distinguish between them in this way, and it is
likely that there are no such implementations.)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999


" ju ********** @ yahoo.co.in" < ju ********** @ yahoo.co.inwrites:
"ju**********@yahoo.co.in" <ju**********@yahoo.co.inwrites:

我可以从main()返回0吗?这相当于

退出(EXIT_SUCCESS)吗?
Can I return 0, from main() ? Is this equivalent to
exit(EXIT_SUCCESS) ?



< http://c-faq.com/> ;,问题11.16,或阅读任何体面的C参考。


-

Keith Thompson(The_Other_Keith) ks***@mib.org < http ://www.ghoti.net/~kst>

在圣地亚哥地区寻找软件开发工作。

我们必须做点什么。这是事情。因此,我们必须这样做。

- Antony Jay和Jonathan Lynn,是部长

<http://c-faq.com/>, question 11.16, or read any decent C reference.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


Richard Heathfield< rj *@see.sig.invalidwrites:
Richard Heathfield <rj*@see.sig.invalidwrites:
ju *** *******@yahoo.co.in 说:

>>
我可以从主页返回0 ()?
>>
Can I return 0, from main() ?



是。


Yes.


>这相当于退出(EXIT_SUCCESS)吗?
>Is this equivalent to exit(EXIT_SUCCESS) ?



在实践中是的。从理论上讲,EXIT_SUCCESS和0都代表成功的终止,但标准并没有禁止他们拥有不同的
值并代表不同类型的成功! (我不知道以这种方式区分它们的任何

实现,并且可能没有这样的实现。)


Yes in practice. In theory, EXIT_SUCCESS and 0 both represent successful
termination but the Standard doesn''t forbid them from having different
values and representing different kinds of success! (I don''t know of any
implementations that distinguish between them in this way, and it is
likely that there are no such implementations.)



模糊异常:对main()和atexit()的递归调用 - 注册

函数引用main()中声明的局部变量。


-

Keith Thompson(The_Other_Keith) ks *** @ mib.org < http://www.ghoti.net/~kst>

在圣地亚哥地区寻找软件开发工作。

我们必须做一些东西。这是事情。因此,我们必须这样做。

- Antony Jay和Jonathan Lynn,是部长

Obscure exceptions: recursive calls to main() and atexit()-registered
functions that refer to local variables declared in main().

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


这篇关于从主要回来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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