Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. Base *pA = new Descendant_G2();
  2.     Base *pA2 = new Descendant();
  3.     Descendant * pb = dynamic_cast<Descendant *>(pA);
  4.     if (pb)
  5.         pb->f3();
  6.     Descendant_G2 * pc = dynamic_cast<Descendant_G2 *>(pA2);
  7.     if (pc)
  8.         pc->f3();
  9.     delete pA;
  10.     delete pA2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement