主函数结束后 执行代码

int f()
{
	cout<<"this is a test of exit !"<<endl;
	return 0;
}

void main()
{
	_onexit(f); //注册的函数会在主函数执行后再执行
	
}

你可能感兴趣的:(主函数结束后 执行代码)