编写一个 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 红包祝福语简短10字
18 周六早晨祝福语简短