stl reverse string c++ code example Example: reverse a vector vector<int> a = {1,2,3,4,5,6}; reverse(a.begin(), a.end());