How to reverse std::string using std::reverse (C++)
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(int argc, char** argv) {
std::string s = "My string";
// This reverses s in-place.
std::reverse(std::begin(s), std::end(s));
// Prints "gnirts yM"
cout << s << endl;
}