binsert2.cpp

We use cookies. Read the Privacy and Cookie Policy

binsert2.cpp

#include ‹iostream.h›

#include ‹stl.h›

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

int main() {

 vector‹char*› names;

 copy(array, array + 3, back_inserter(names));

 vector‹char*›::iterator i;

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

 return 0;

}