编写一个 C 程序来检查 atexit() 函数
该atexit()函数允许用户注册必须根据程序终止调用的函数。
它是包含在stdlib头文件中的预定义函数。
示例1
#include输出结果#include void welcome(void){ printf("Welcome to New,"); } void world(void){ printf("World\n"); } int main(){ //测试atexit,调用用户定义的函数 atexit(world); atexit(welcome); return 0; }
Welcome to New,World
示例2
#include输出结果#include void first(void){ printf("This is a beautiful,"); } void second(void){ printf("Wonderful life\n"); } int main(){ //测试atexit,调用用户定义的函数 atexit(second); atexit(first); return 0; }
This is a beautiful,Wonderful life
热门推荐
10 祝孙辈生日祝福语简短
11 恋人跨年祝福语大全简短
12 考大学敬酒简短祝福语
13 开工投产大吉祝福语 简短
14 偶然结婚祝福语朋友简短
15 感谢学长学姐祝福语简短
16 戏精的祝福语简短
17 我要结婚祝福语简短
18 婚前女儿生日祝福语简短