Is there a better way of printing a vector in reverse order then this:
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
void print_elem(int elem)
{
cout << elem << endl;
}
int main()
{
int ia[4]={1,2,3,4};
vector<int> vec(ia,ia+4);
reverse(vec.begin(), vec.end());
for_each(vec.begin(),vec.end(),print_elem);
reverse(vec.begin(), vec.end());
}