copy2.cpp

We use cookies. Read the Privacy and Cookie Policy

copy2.cpp

#include ‹stl.h›

#include ‹iostream.h›

int main() {

 vector‹int› v(10);

 for (int i = 0; i ‹ v.size(); i++) v[i] = i;

 ostream_iterator‹int› iter(cout, " ");

 copy(v.begin(), v.end(), iter);

 cout ‹‹ endl;

 return 0;

}