copy2.cpp
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;
}
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;
}