interator operator for vector : vector iterator « Vector « C++






interator operator for vector

   
#include <vector>
using namespace std;

int main(int argc, char** argv)
{
  vector<int> intVector(10, 0);

  vector<int>::iterator it = intVector.begin();
  it += 5;
  --it;
  *it = 4;

  return (0);
}
  
    
    
  








Related examples in the same category

1.Display contents of vector through an iterator
2.Use const_iterator to loop through the vector
3.Change contents of vector through an iterator
4.Loop through all elements in a vector in reverse order by using rbegn, rend
5.vector.begin, vector.end returns the iterators
6.const_iterator from different containers