Reverse a string

May 1, 2014 at 5:49pm
figured it out! thank you :)
Last edited on May 1, 2014 at 6:07pm
May 1, 2014 at 5:59pm
you can use a string constructor to do the job:
 
string reverse(str.end(), str.begin());


now reversed hold the reveresed string - (you simply need the iterator to start at the end of your string and stop at the beginning).
Last edited on May 1, 2014 at 6:06pm
Topic archived. No new replies allowed.