title: stackoverflow by a recursion
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4106708/runtime-exception-recursion-too-deep">Runtime exception, recursion too deep</a>  </p>
  </blockquote>
  
  
  
  <p>I'm getting a problem while developing a c#.net program and I've simplified it to a simple problem, I need to understand why does this code throw a stackoverflow exception if I call the function like this :</p>
  
  <pre><code>CheckFunc(16000);
  </code></pre>
  
  <p>but works fine if I call it like this</p>
  
  <pre><code>CheckFunc(1000);
  </code></pre>
  
  <p>here is the function :</p>
  
  <pre><code>private void CheckFunc(Int32 i)
  {
      if (i == 0)
          MessageBox.Show("good");
      else
          CheckFunc(i - 1);
  }
  </code></pre>
  
  <p>tried to make the code as simple as it can get...</p>
  
  <p>I understand that there is a stack that gets overflowed but which stack ? How can I fix this ?</p>
  
  <p>Thanks.</p>