Iterator_1.2

#include <iostream>
#include <iterator>
#include <vector>
using namespace std;
#define pb push_back
int main()
{
      vector <int> a;
      vector <int>::iterator i;
      a.pb(10);
      a.pb(11);
      a.pb(12);
      a.pb(13);
      for(i=a.begin();i<a.end();i++)
      {
          cout<<*i<<endl;
      }
      system("pause");
      return 0;
}
      


This is the output:
10
11
12
13

0 comments:

Post a Comment