Be gentle I am new at this but I need some help. I have to create a function and then use it recursively so that it reverses the string. This is my program so far..
My dilema is that all it prints is the 'h', I know that there is more code to this but I am at a loss...any helpful hints or suggestions??
using namespace std;
string Reverse(string s, int m); //reverse s from
//character at m-th position out to the end
// MAIN PROGRAM
int main ()
string s = "GeorgeWBush";
cout << Reverse(s,0) << endl;
//IMPLEMENTATION OF PROTOTYPE
string Reverse(string s, int m)
string t = ""; //null string
if (m == s.length()-1)
return t + s[s.length()-1];
return Reverse (s, m+1);