?
This document uses PHP Chinese website manual Release
在頭文件<stdlib.h>中定義 | ||
---|---|---|
_Noreturn void quick_exit(int exit_code); | (自C11以來) |
導(dǎo)致正常的程序終止發(fā)生,而沒有完全清理資源。
傳遞給at_quick_exit的函數(shù)按其注冊的相反順序調(diào)用。 調(diào)用注冊函數(shù)后,調(diào)用_Exit(exit_code)。
exit_code | - | 退出程序的狀態(tài) |
---|
(none).
#include <stdlib.h>#include <stdio.h> void f1(void){ puts("pushed first"); fflush(stdout);} void f2(void){ puts("pushed second");} int main(void){ at_quick_exit(f1); at_quick_exit(f2); quick_exit(0);}
輸出:
pushed second pushed first
C11標(biāo)準(zhǔn)(ISO / IEC 9899:2011):
7.22.4.7 quick_exit函數(shù)(p:353)
abort | 導(dǎo)致程序異常終止(不清除)(功能) |
---|---|
atexit | 注冊要在exit()調(diào)用(函數(shù))上調(diào)用的函數(shù) |
at_quick_exit(C11) | 注冊要在quick_exit調(diào)用(函數(shù))上調(diào)用的函數(shù) |
| 用于quick_exit的C ++文檔 |