Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Base *pA = new Descendant_G2();
- Base *pA2 = new Descendant();
- Descendant * pb = dynamic_cast<Descendant *>(pA);
- if (pb)
- pb->f3();
- Descendant_G2 * pc = dynamic_cast<Descendant_G2 *>(pA2);
- if (pc)
- pc->f3();
- delete pA;
- delete pA2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement