在C出口功能 [英] Exit functions in C

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

问题描述

之间有什么区别的退出() _exit() _Exit()用C?

What is the difference between exit(), _exit() and _Exit() in C?

我如何决定使用哪一种?

How do I decide which to use?

在bash中,

2人退出

给我的页_exit(2),而

gave me the page _EXIT(2), whereas

3人退出

给网页EXIT(3)。

gave the page EXIT(3).

推荐答案

退出()清理后终止。

_exit()呼叫后立即终止。

如果你有一些堆栈损坏,而退出()函数被调用程序可能会分割故障关闭,如果你是使用 _exit(),程序退出在快速模式。

If you have some stack corrupted while exit() function was called program may close with Segmentation Fault, if you are use _exit(), program exit in quick mode.

http://msdn.microsoft.com/en-us/library /6wdz5232.aspx 你有

退出() - 执行完整的C库终止程序,终止进程,并使用附带的状态code退出

exit() - Performs complete C library termination procedures, terminates the process, and exits with the supplied status code.

_exit() - 执行快速C库终止程序,终止进程,并退出与所提供的状态code

_exit() - Performs quick C library termination procedures, terminates the process, and exits with the supplied status code.

_cexit() - 执行完整的C库终止程序,并返回给调用者,但不会终止进程

_cexit() - Performs complete C library termination procedures and returns to the caller, but does not terminate the process.

_c_exit() - 执行快速C库终止程序,并返回给调用者,但不会终止进程

_c_exit() - Performs quick C library termination procedures and returns to the caller, but does not terminate the process.

这篇关于在C出口功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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