跳转到内容

The Wikibooks community is developing a policy on the use of generative AI. Please review the draft policy and provide feedback on its talk page.

C++ 编程/代码/标准 C 库/函数/atexit

来自,自由的教科书

atexit

[编辑 | 编辑源代码]
语法
#include <cstdlib>
int atexit( void (*func)(void) );

atexit() 函数使程序终止时调用 func 指向的函数。你可以多次调用 atexit()(至少 32 次,具体取决于你的编译器),这些函数将按照建立的相反顺序调用。atexit() 函数在成功时返回零,失败时返回非零值。

相关主题
abort - exit
取自 "https://wikibooks.cn/w/index.php?title=C%2B%2B_Programming/Code/Standard_C_Library/Functions/atexit&oldid=3676658"
华夏公益教科书