Thread: vectors

  1. #1
    essence of digital xddxogm3's Avatar
    Join Date
    Sep 2003


    i'm new to vectors and wanted some clearification to what this says. I'm assuming I understand, but I have been wrong before.

    #include <vector>
    vector<int> v;
    vector<int>::iterator iter1 = v.begin();
    instansiate a vecotor, assign that vectors iterator (counter) the address of the begining of the vecotor?

    does every vector container have an iterator?

    please forgive me if i'm way off, but this is my first time even looking at a vector.
    Last edited by xddxogm3; 11-21-2005 at 07:29 PM.
    "Hence to fight and conquer in all your battles is not supreme excellence;
    supreme excellence consists in breaking the enemy's resistance without fighting."
    Art of War Sun Tzu

  2. #2
    Registered User
    Join Date
    Apr 2003
    does every vector container have an iterator?
    Yep, several. All the STL containers have at least two iterators: a regular iterator like in your code, which is read/write and a const interator which is read only:

    Last edited by 7stud; 11-21-2005 at 09:27 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vectors
    By naseerhaider in forum C++ Programming
    Replies: 11
    Last Post: 05-09-2008, 08:21 AM
  2. How can i made vectors measuring program in DevC++
    By flame82 in forum C Programming
    Replies: 1
    Last Post: 05-07-2008, 02:05 PM
  3. How properly get data out of vectors of templates?
    By 6tr6tr in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 10:35 AM
  4. How to use Vector's in C++ !?!
    By IndioDoido in forum C++ Programming
    Replies: 3
    Last Post: 10-14-2007, 11:13 AM
  5. Points, vectors, matrices
    By subnet_rx in forum Game Programming
    Replies: 17
    Last Post: 01-11-2002, 02:29 PM