stl function to reverse the string 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;
}