as soon as start program got error message - stack overflow
-
As soon as start program, not operate on any array yet, got error message: Unhandled exception at 0x77c315de in blast_frag.exe: 0xC00000FD: Stack overflow. Please help why ? Thanks
-
As soon as start program, not operate on any array yet, got error message: Unhandled exception at 0x77c315de in blast_frag.exe: 0xC00000FD: Stack overflow. Please help why ? Thanks
Typical sources for stack overflows are declaring large objects on the stack and recursive function calls:
void some_func()
{
// May result in stack overflow if the sizes are close to the stack size
int large_array[500000];
CSomeLargeObject Obj;// Recursive function without stop condition some\_func(); // Recursive call if some\_other\_func() calls some\_func() some\_other\_func();
}
Large objects on the stack should be avoided. Use dynamic memory allocation instead (
new
ormalloc()
). So check your code for the above conditions. To detect recursive calls, use the debugger and check the functions that are called for recursions. -
mrby123 wrote:
Please help why ?
Because you have a bug in your code.
Veni, vidi, abiit domum
-
As soon as start program, not operate on any array yet, got error message: Unhandled exception at 0x77c315de in blast_frag.exe: 0xC00000FD: Stack overflow. Please help why ? Thanks
So stop using so much stack. Functions calling themselves endlessly is the usual cause. Dont do it.