A question on vectors, pointers and iterators

Posted by xbonez on Stack Overflow See other posts from Stack Overflow or by xbonez
Published on 2010-05-19T00:30:46Z Indexed on 2010/05/19 0:40 UTC
Read the original article Hit count: 265

Filed under:

Guys, I have a midterm examination tomorrow, and I was looking over the sample paper, and I'm not sure about this question. Any help would be appreciated.

Let v be a vector<Thingie*>, so that each element v[i] contains a pointer to a Thingie. If p is a vector<Thingie*>::iterator, answer the following questions:

  1. what type is p?
  2. what type is *p?
  3. what code provides the address of the actual Thingie?
  4. what code provides the actual Thingie?

© Stack Overflow or respective owner

Related posts about c++