reverse a string in stl code example
Example: string reverse stl
int main() {
string str = "foobarbaz";
reverse(str.begin(), str.end());
cout << str; // prints "zabraboof"
return 0;
}
int main() {
string str = "foobarbaz";
reverse(str.begin(), str.end());
cout << str; // prints "zabraboof"
return 0;
}