Function that reverses a string?

Basically I'm supposed to write a program that computes the reverse of a string. for example the word "flow" would be "wolf". the book says to to start at the second characted and reverse the string from there adding the first character to the end, but I have no idea how to even start. Can somebody help?
C++ has the function reverse(), so normally you wouldn't need to do anything to individual characters.
It would be nice if you wrote more about the proposed algorithm, perhaps it's something along the lines of
return my_reverse(str.substr(1)) + str[0];? What is this part of the book talking about?
Last edited on
Topic archived. No new replies allowed.