I am a c++ newbie and I am trying something very similar. Here's my code -
The error is 'request for member 'p' in ...., which is of non-class type ....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; }
Basically, I need to print the value for p. Where am I going wrong?
Thanks for your help in advance.
Raj