
please wait
cp->Child_display();
|
|
Child_display()
? No.dynamic_cast
does not modify object. You can't cast a pointer to be Child* unless the pointed to object is a Child.dynamic_cast <Parent *> new Parent()
makes no sense. The new
returns Parent*. You try to cast it into Parent* ? Useless no-op cast.Parent* p = new Child;
Child* p = new Parent;