How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?
Note that the beauty of std::reverse is that it works with char * strings and std::wstrings just as well as std::strings
char *
std::wstring
std::string
void strrev(char *str) { if (str == NULL) return; std::reverse(str, str + strlen(str)); }