title: How does recursion know when to stop?
body: <p>Why does this work:</p>
  
  <pre><code>void reversal(string x, int y){
         if (x[y] == '\0'){
         } else {
              reversal(x,y+1);
              cout &lt;&lt; x[y];
         }
      }
  </code></pre>
  
  <p>And this doesnt?:</p>
  
  <pre><code> void reversal(string x, int y){
          reversal(x,y+1);
          cout &lt;&lt; x[y];
   }
  </code></pre>
  
  <p>Why doesn't the loop repeat forever (even though it doesn't do anything past the string size). Is a blank 'if' statement the way to end recursive functions?</p>