Thread: Iterators question

  1. #1
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    CA, USA

    Iterators question

    If I am passing a const reference to a vector (const vector<CustomerData> &c) to a function, is it possible to declare an iterator for it inside the function? I am getting compiler error that iterator cannot be instantiated here. Works fine when I pass by value (ie: non-const).

    Hrm, nevermind. So simple... who would've thought the STL programmers made a const_iterator type.
    Last edited by MacNilly; 02-18-2006 at 06:10 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  3. Question...
    By TechWins in forum A Brief History of
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 01:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM