Implement a function which reverses a string in C++ (on the whiteboard)
Anoniem
What I should have implemented, if I had known about reverse iterators, back_inserter, and copy function in STL: std::string reverse( const std::string& s ) { std::string r; std::copy( s.crbegin(), s.crend(), std::back_inserter(r); return r; }