Back to notes -- Keyboard shortcut: 'u'              Slide program -- Keyboard shortcut: 't'    The same program using a reverse iterator.Lecture 5 - slide 18 : 39
Program 1
#include <iostream>
#include <string>
#include <vector>

int main(){
  using namespace std;

  vector<double> vd;

  for(int i = 1; i <= 10; i++)
     vd.push_back(i + i/10.0);

  typedef vector<double>::reverse_iterator vec_it;

  vec_it it1 = vd.rbegin();

  while(it1 != vd.rend()){
     cout << *it1 << " ";   // 11 9.9 8.8 7.7 6.6 5.5 4.4 3.3 2.2 1.1 
     ++it1;
  }
}