title: Segmentation Fault on Recursion
body: <p>I want to count the number of recursivily call that has a number in the Collatz Sequence. But for such a bigger number for example 4565458458  </p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;sstream&gt;
  using namespace std;
  
  int f(int value){
      if(value==1) return 1;
      else if(value%2 == 0) return value/2;
      else return 3*value+1;
  }
  
  int g(int value){
     if(value == 0) return 0;
     if (f(value)==1) return 1;
     return 1 + g(f(value));
  }
  
  int main(int argc, char *argv[]){
      int nSteps=0;
      istringstream iss(argv[1]);
      int;
      if(!(iss &gt;&gt; num).fail()){
          if(num &lt; 0) cout &lt;&lt; "0" &lt;&lt; endl;
          else{
              nSteps = g(num);
              cout &lt;&lt; "Result: " &lt;&lt; nSteps &lt;&lt; endl;
          } 
      }
      else{
          cout &lt;&lt; "Incorrect line paramaters: ./g n" &lt;&lt; endl;
      }
      return 0;
  }
  </code></pre>