How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?
#include std::reverse(str.begin(), str.end());
This is the simplest way in C++.