reverse a string in c++ function code example Example: Reverse string C++ reverse(str.begin(),str.end());