SyntaxFix
Write A Post
Hire A Developer
Questions
There's a function std::reverse in the algorithm header for this purpose.
std::reverse
algorithm
#include <vector> #include <algorithm> int main() { std::vector<int> a; std::reverse(a.begin(), a.end()); return 0; }