ExitProcess(0)
Windows核心编程中,有个例子
class test
{
public:
test(){printf("Constructor\n");}
~test(){printf("Destructor\n");}
};
test t1;
int _tmain(int argc, _TCHAR* argv[])
{
test t2;
ExitProcess(0);
return 0;
}
说上说只会有两个Constructor输出,而不会有Destructor,但我用VS2008测试会有两个Constructor和一个Destructor,而且测试过Destructor应该是局部变量析构的结果。这难道又是编译器不同的结果??