如何在VC ++ 2010中增加堆栈大小 [英] How do I increase stack size in VC++ 2010

查看:464
本文介绍了如何在VC ++ 2010中增加堆栈大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对用C ++编写并使用Visual Studio Express 2010编译的程序的复杂对话框显示进行了一些更改。当我选择对话框时,程序以无限循环结束。当我调试对话框过程时,我在初始化步骤中收到堆栈过载消息。如何合并更大的堆栈?

I made some changes to a complex dialog box display for a program written in C++ and compiled with Visual Studio Express 2010. The program ends up in an infinite loop when I select the dialog box. When I debug the dialog box procedure I get a stack overload message during the initialization step. How do I incorporate a larger stack?

推荐答案

这是一个惊人的逻辑:如果你看到你的堆栈溢出,你会问如何增加它。好吧,增加两次,使溢出时间延长两倍。你不需要它。



相反,你需要修复你的错误。机会是,这是递归,所以,首先,尝试找出你的递归没有完成的原因。请参阅:

http://en.wikipedia.org/wiki/Recursion [< a href =http://en.wikipedia.org/wiki/Recursiontarget =_ blanktitle =New Window> ^ ],

http://en.wikipedia.org/wiki/Recursion_%28computer_science%29 [ ^ ],

http://en.wikipedia.org/wiki/Mutual_recursion [ ^ ]。



-SA
This is amazing logic: if you see your stack overflow, you ask how to increase it. All right, increase it twice, to have the overflow by twice as long time. You don't need it.

Instead, you need to fix your bugs. Chances are, this is recursion, so, first of all, try to find why your recursion did not finish. Please see:
http://en.wikipedia.org/wiki/Recursion[^],
http://en.wikipedia.org/wiki/Recursion_%28computer_science%29[^],
http://en.wikipedia.org/wiki/Mutual_recursion[^].

—SA


这篇关于如何在VC ++ 2010中增加堆栈大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆