C学习笔记 13 atexit 在main函数调用结束后调用函数
来源:互联网 发布:linux命令行刻录光盘 编辑:程序博客网 时间:2024/05/11 06:06
atexit
函数名: atexit 功 能: 注册终止函数(即main执行结束后调用的函数) 用 法: int atexit(atexit_t func); 注意:atexit()注册的函数类型应为不接受任何参数的void函数,exit调用这些注册函数的顺序与它们 登记时候的顺序相反。 程序例: #include <stdio.h> #include <stdlib.h> void exit_fn1(void) { printf("Exit function #1 called/n"); } void exit_fn2(void) { printf("Exit function #2 called/n"); } int main(void) { /* post exit function #1 */ atexit(exit_fn1); /* post exit function #2 */ atexit(exit_fn2); return 0; } 输出: Exit function #2 called Exit function #1 called
- C学习笔记 13 atexit 在main函数调用结束后调用函数
- atexit函数,main结束后,运行fn1,fn2
- atexit()函数调用
- C语言在main前调用函数
- atexit()函数调用注册函数的顺序
- atexit函数调用注册函数的顺序
- linux 0.11 内核学习 -- main.c,调用函数而已。
- 函数单独编译与函数在main函数中调用编译后生成汇编代码对比
- C++_静态局部变量的值在函数结束后不会释放,也不会被外部调用
- 调用函数结束
- c++:谁调用了main/WinMain函数!
- 在main函数执行结束后再执行的代码
- 在main()之前调用Bootstrap函数
- atexit()函数调用注册的顺序
- 在popViewControllerAnimated后调用函数
- main函数的调用
- main函数调用自身
- atexit(在main函数执行完毕后,是否可能再执行一段代码?)
- Qt学习例子1——HelloWorld
- Qt学习例子2——CalculatorInterface
- Qt学习例子3——test
- 360清理系统致office2003无法安装解决办法
- Qt学习例子4——Test2_1
- C学习笔记 13 atexit 在main函数调用结束后调用函数
- Release Type
- 十三个经典算法研究与总结、目录+索引
- temp
- Qt学习例子5——calculatorwidget
- 全面解析跨站脚本攻击
- 通过脚本在PowerDesigner PDM中将唯一索引批量转成主键
- 十条不错的编程观点
- Qt学习例子6——customtype