Access via iterator to pointer container
I am a c++ newbie and I am trying something very similar. Here's my code -
Code:
class A
{
protected:
Pointer * p;
double d;
};
class B:public A
{
.
.
}
int main()
{
for (list<B *>::const_iterator it = listeB_.begin(); it!=listeB_.end(); it++)
{
cout << (it->p)->getNumero() << endl;
}
The error is 'request for member 'p' in ...., which is of non-class type ....
Basically, I need to print the value for p. Where am I going wrong?
Thanks for your help in advance.
Raj