iter3.cpp

We use cookies. Read the Privacy and Cookie Policy

iter3.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*›::reverse_iterator i;

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

 return 0;

}