main主函数执行完毕后,是否可能会再执行一段代码
来源:互联网 发布:越狱软件闪退 编辑:程序博客网 时间:2024/05/29 03:19
可以使用atexit()函数注册一个函数 1.#include 2. 3.//功能:Processes the specified function at exit. 4.//格式:int atexit( void ( __cdecl *func )( void ) ); 5.//描述:The atexit function is passed the address of a function (func) to be 6.// called when the program terminates normally. Successive calls to atexit 7.//create a register of functions that are executed in LIFO (last-in-first-out) 8.//order. The functions passed to atexit cannot take parameters. atexit and 9.//_onexit use the heap to hold the register of functions. Thus, the number of 10.// functions that can be registered is limited only by heap memory. 11.int atexit (void (*function)(void)); 12. 13. 14.#include 15. 16.void fun1(void); 17. 18.void fun2(void); 19. 20.void fun3(void); 21. 22.void fun4(void); 23. 24.void main() 25. 26.{ 27. 28. atexit(fun1); 29. 30. atexit(fun2); 31. 32. atexit(fun3); 33. 34. atexit(fun4); 35. 36. printf("this is executed first./n"); 37. 38.} 39. 40.void fun1() 41.{ 42. printf("next./n"); 43.} 44. 45.void fun2() 46.{ 47. printf("executed "); 48.} 49. 50.void fun3() 51.{ 52. printf("is "); 53.} 54. 55.void fun4() 56.{ 57. printf("this "); 58.}
- main 主函数执行完毕后,是否可能会再执行一段代码?
- main主函数执行完毕后,是否可能会再执行一段代码?
- main主函数执行完毕后,是否可能会再执行一段代码
- main 主函数执行完毕后,是否可能会再执行一段代码,给出说明?
- main主函数执行完毕后,是否可能会再执行一段代码
- C语言main()主函数执行完毕后是否会再执行一段代码
- main主函数执行完毕后,是否会再执行一段代码?
- atexit(在main函数执行完毕后,是否可能再执行一段代码?)
- 面试例题4—main函数执行完毕后,是否会再执行一段代码
- main函数执行完毕,能否再执行一段代码
- main ()函数执行完后是否会再执行一段代码?
- main 主函数执行完毕后可以再执行其它代码
- main主函数执行完后,可以利用atexit再执行一段代码
- _onexit函数的使用 完成主函数执行完毕后再执行一段程序
- 怎样在main()函数退出之后再执行一段代码?
- 在main 函数执行前、后再执行的代码
- main函数执行前、后再执行的代码
- main函数执行前、后再执行的代码
- return 局部变量
- MySqlHelper备份
- NDK编程实例
- VS2005/2008虚拟Web服务器外部工具的设置
- 杭州的薪资水平
- main主函数执行完毕后,是否可能会再执行一段代码
- boost.property_tree使用示例
- 测试用例模板
- 全角转半角,提取数字,提取英文,提取中文,过滤重复字符,过滤重复字符2
- C语言课设之电话查询系统。
- DiskPerf代码分析(供学习驱动开发的朋友参考)
- Bug报告编写模板
- 我的生活需要这些‘鸦片’
- 过滤器,但是asp.net 提交时候怎么过滤form里的具体值呢,大部分提交又不是访问页,已经解决