For my void function reverse, I have to get a string and reverse it with recursion.
So far, I have
void reverse(string &s)
{
string b = s;
s = s.substr(1) + s.at(0);
}
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?
shas no type so the rest of your code is suspect.reversedoes not return a value but you expect it to.reversewithinreverse