76
Graphics / Making a Map from a file, stack overload error
« on: July 31, 2011, 07:34:00 am »
You typically get a stack overflow one of two ways:
1) Having an array on the stack that's way too big
or
2) Having a function that's infinitely recursive (calls itself) -- or a series of functions that loop into calling themselves.
Are you doing either of these?
1) Having an array on the stack that's way too big
Code: [Select]
int func()
{
int waytoobig[100000]; // bad idea to put all this on the stack!
}
or
2) Having a function that's infinitely recursive (calls itself) -- or a series of functions that loop into calling themselves.
Code: [Select]
void func1()
{
func2();
}
void func2()
{
func1();
}
// func1 calls func2
// and func2 calls func1
// so this will suck up stack space until you run out
Are you doing either of these?