title: How can I increase the stack memory?
body: <p>Duplicate of <a href="https://stackoverflow.com/questions/743545/how-to-allow-more-memory-and-avoid-stack-overflow-on-lots-of-recursion">How to allow more memory and avoid stack overflow on lots of recursion?</a></p>
  
  <p>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++:</p>
  
  <pre><code>void f(int k)
  {
     if(k==10000) return;
     f(k+1);
  } 
  
  void main()
  {
     f(1);
     return;
  }
  </code></pre>
  
  <p>could anybody help?</p>