In article <>,
says...
[ ... ]
> string inverse(string s)
The library already provides enough to let you do this in one line of
code quite easily. First of all, when you want to traverse some
collection (and for this purpose, a string qualifies as a collection) in
reverse, you usually want to use a reverse_iterator. Most collections
provide begin() and end(). Those that support reverse_iterators normally
suppose rbegin() and rend() as well.
std::string also has a ctor that takes a pair of iterators as arguments
to specify the contents of the new string.
--
Later,
Jerry.
The universe is a figment of its own imagination.