home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / iter3.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  671b  |  28 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <iostream>
  5. #include <vector>
  6. #include <algorithm>
  7.  
  8. #ifdef MAIN 
  9. #define iter3_test main
  10. #endif
  11.  
  12. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  13. using namespace std;
  14. #endif
  15.  
  16. int iter3_test(int, char**)
  17. {
  18.   cout<<"Results of iter3_test:"<<endl;
  19.   typedef vector<const char*> Vec;
  20.   Vec v; // Vector of character strings.
  21.   v.push_back((char*) "zippy"); // First element.
  22.   v.push_back((char*) "motorboy"); // Second element.
  23.   Vec::reverse_iterator it;
  24.   for(it = v.rbegin(); it != v.rend(); it++)
  25.     cout << *it << endl; // Display item.
  26.   return 0;
  27. }
  28.