#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
void print(int elem)
{
cout << elem << " ";
}
int main(int argc, char** argv)
{
vector<int> vectOne, vectTwo;
vectOne.push_back(1);
vectOne.push_back(2);
vectOne.push_back(3);
vectOne.push_back(4);
vectTwo.resize(vectOne.size());
copy(vectOne.begin(), vectOne.end(), vectTwo.begin());
for_each(vectTwo.begin(), vectTwo.end(), &print);
return (0);
}
|