string reverse stl

Solutions on MaxInterview for string reverse stl by the best coders in the world

showing results for - "string reverse stl"
Simon
13 Nov 2019
1int main() { 
2    string str = "foobarbaz";
3    reverse(str.begin(), str.end()); 
4    cout << str; // prints "zabraboof"
5    return 0; 
6}