binsert1.cpp

We use cookies. Read the Privacy and Cookie Policy

binsert1.cpp

#include ‹iostream.h›

#include ‹stl.h›

char* array[] = {"laurie", "jennifer", "leisa"};

int main() {

 vector‹char*› names;

 copy(array, array + 3, back_insert_iterator‹vector‹char*› ›(names));

 vector‹char*›::iterator i;

 for (i = names.begin(); i!= names.end(); i++) cout ‹‹ *i ‹‹ endl;

 return 0;

}