Duplicate of http://stackoverflow.com/questions/743545/how-to-allow-more-memory-and-avoid-stack-overflow-on-lots-of-recursion
I'm writing a branch and bound algorithm which has at least 10000 levels by a recursive function,but it doesn't work due to a stack overflow error. here is a simple instance of my program in C++:
void f(int k)
{
if(k==10000) return;
f(k+1);
}
void main()
{
f(1);
return;
}
could anybody help?