title: Why stack overflow on some machines, but segmentation fault on another?
body: <p>Just out of curiosity, I'm trying to generate a stack overflow. This code generates a Stack Overflow <a href="http://www.cplusplus.com/forum/beginner/44001/">according to the OP</a>, but when I run it on my machine, it generates a segmentation fault:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int num = 11;
  unsigned long long int number = 22;
  
  int  Divisor()
  {
      int result;
      result = number%num;
  
      if (result == 0 &amp;&amp; num &lt; 21)
      {
          num+1;
          Divisor();
  
          if (num == 20 &amp;&amp; result == 0)
          {
              return number;
          }
      }
  
      else if (result != 0)
      {
          number++;
          Divisor();
      }
  }
  
  int main ()
  {
      Divisor();
      cout &lt;&lt; endl &lt;&lt; endl;
      system ("PAUSE");
      return 0;
  }
  </code></pre>
  
  <p>Also, according to <a href="https://stackoverflow.com/questions/1657484/can-you-give-an-example-of-stack-overflow-in-c">this</a> post, some examples there should also do the same. Why is it I get segmentation faults instead? </p>