Archived

This topic is now archived and is closed to further replies.

Austrian Coder

Stack Overflow

Recommended Posts

Hi! I get this error if i start my app: untreated exception in Demo_1.exe(Kernel32.Dll): 0xC00000FD: Stack Overflow All runs very fine but ´when i close the app i get this error (VC++ Debugger). Can someone help me?

Share this post


Link to post
Share on other sites
Allocate large data structures on heap (new,malloc) instead of stack. An example:

  
// bad

int large_array[1024][1024];
// better, i.e. no stack overflow issues

int* large_array = new int[1024*1024];


Hope this helps,
Pat

PS: You can also increase you stack frame (look at the VC documentation for more info on this topic).

Share this post


Link to post
Share on other sites
You''ve got a heck of a lot of stack space in Windows, it grows the stack automagically.

I''d say the stack overflow is caused by a bad recursive call (i.e. no return path to halt the recursion).

Share this post


Link to post
Share on other sites