how to prevent stack-overflow?
I write some codes based in recursive method(or some similar methods),eg. in maze-searching... they work ,but sometimes cause stack-overflow.
i try to write a function to prevent this, but i don't know if it works...
1: use a varible size to count the number of recursion times
2: after each call, check size using following code
the problem is that i'm not clear how many steps can a system stack hold...
if (size == 4*BUFSIZ)//prevent stack overflow after too many setps
printf("\nMaze too large,Stack overflowed!");
plz help with this, thanks