eda*_*oyo 10 c program-entry-point
当main()退出C时,是否可以调用额外的函数?
谢谢!
Jam*_*lis 23
您可以main使用该atexit功能注册退出后运行的功能.
main
atexit
MSDN有一个很好的简洁示例,说明了如何完成.基本上,注册的功能以与注册时atexit相反的顺序执行.
Gra*_*row 9
试试这个atexit()功能:
atexit()
void myfunc() { /* Called when the program ends */ } int main( int arc, char *argv[] ) { atexit( myfunc ); ... return 0; }
归档时间:
16 年,3 月 前
查看次数:
612 次
最近记录:
15 年,1 月 前