Iterators question

This is a discussion on Iterators question within the C++ Programming forums, part of the General Programming Boards category; If I am passing a const reference to a vector (const vector<CustomerData> &c) to a function, is it possible to ...

  1. #1
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Posts
    320

    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 05: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 Cprogramming.com
    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, 12:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 12:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21