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