编写一个 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 50多岁生日简短祝福语
13 安徽疫情祝福语简短英语
14 农民朋友发财祝福语简短
15 对生活祝福语简短精辟
16 搬家词简短祝福语朋友
17 女神结婚快乐祝福语简短
18 文学短句祝福语大全简短