C
ctick
class A
{
public:
method_A() { cout << "A method " << endl; }
};
class B : public A
{
public:
method_B() { cout << "B method " << endl; }
};
int main()
{
A* aptr = new B;
....
}
Why cann't "aptr" see method_B() of class B since "aptr" is a pointer
pointing actually at an object of type B?
Thanks in advance!
{
public:
method_A() { cout << "A method " << endl; }
};
class B : public A
{
public:
method_B() { cout << "B method " << endl; }
};
int main()
{
A* aptr = new B;
....
}
Why cann't "aptr" see method_B() of class B since "aptr" is a pointer
pointing actually at an object of type B?
Thanks in advance!