title: Using recursion for a function with a pass by reference parameter?
body: <p>For my void function reverse, I have to get a string and reverse it with recursion.</p>
  
  <p>So far, I have </p>
  
  <pre><code>void reverse(string &amp;s)
  {
      string b = s;
      s = s.substr(1) + s.at(0);
  }
  </code></pre>
  
  <p>but it won't work because of the pass by reference requirement for the function.  How do I utilize the pass by reference for recursion?  </p>