iter1.cpp

iter1.cpp

#include ‹iostream.h›

#include ‹stl.h›

int main() {

 vector‹const char*› v; // Vector of character strings.

 v.push_back((char*) "zippy"); // First element.

 v.push_back((char*) "motorboy"); // Second element.

 vector‹const char*›::iterator i = v.begin(); // Position at end.

 for (i = v.begin(); i != v.end(); i++) cout ‹‹ *i ‹‹ endl; // Display item.

 return 0;

}