Q:

Copy a vector to another vector in reverse order

I am new in C++.
I need to copy a vector in reverse order to another vector.
Here's how i did it :
int temp[] = {3, 12, 17};

vector<int>v(temp, temp+3);

vector<int>n_v;

n_v=v;
reverse(n_v.begin(), n_v.end()); //Reversing new vector

Is there any simple way to copy a vector in reverse order to another vector in STL?

A:

Simply just do this:
vector<int>n_v (v.rbegin(), v.rend());

