Example - void atexit(void)
来源:互联网 发布:松下剃须刀哪款好 知乎 编辑:程序博客网 时间:2024/06/07 04:10
//author:DriverMonkey//date:1/24/2013//copyright: no copyright//mail:bookworepeng@hotmail.com//enviromen:Ubuntu#include <iostream>#include <stdlib.h>using namespace std;static void first_atexit(void);static void second_atexit(void);static void third_atexit(void);int main(int argc, char *argv[]){cout<<"main()++"<<endl;if(atexit(first_atexit) != 0)cout<<"first_atexit() register failed"<<endl;if(atexit(second_atexit) != 0)cout<<"first_atexit() register failed"<<endl;if(atexit(third_atexit) != 0)cout<<"first_atexit() register failed"<<endl;cout<<"main()--"<<endl;return 0;}static void first_atexit(void){cout<<"first_atexit() succesfull"<<endl;}static void second_atexit(void){cout<<"second_atexit() succesfull"<<endl;}static void third_atexit(void){cout<<"third_atexit() succesfull"<<endl;}
terminal output:
main()++
main()--
third_atexit() succesfull
second_atexit() succesfull
first_atexit() succesfull
- Example - void atexit(void)
- void *
- void
- void
- void
- void
- void
- void*
- void
- void
- void
- void
- void
- void
- void
- (void**)&
- void *
- void
- 【SWF】 —— 极限研究
- 就知道1234
- Apache xerces xml解析器
- 根据给定概率随机按行分割文件
- 仙剑奇侠传5杂感
- Example - void atexit(void)
- rtp server
- 交换排序:冒泡排序,快速排序
- C/C++开发环境(GTK/GNOME/Qt/KDE)
- DBCP连接池的配置
- python模块——logging(日志管理)
- 数据库约束
- 让vim识别更多编码
- android 广播 BroadcastReceiver