C++做的Win32程序突然退出
另外,我做了一个MFC的程序调这个函数:
void CauseStackOverflow (int i)
{
// Overflow the stack by allocating a large stack-based array
// in a recursive function.
int a[10000*1000];
memset(a,NULL,sizeof(a));
printf("%d ", i);
CauseStackOverflow (i + 1);
}
但release版程序耗尽CPU,但没有被终结,是为什么呢?
C++做的Win32程序突然退出
请问楼上, 你指的数据栈是否就是函数调用的堆栈?
我的编译选项是这样的:
/STACK: 0
This option specifies the total stack allocation in virtual memory. The default stack size is 1 MB.