Advertisement
Guest User

CPP

a guest
Jan 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. #include <iostream>
  2. class A {public: virtual ~A() = default;};
  3. class B : public A {};
  4. class C : public A {};
  5.  
  6. int main() {
  7.   A* a = new B();
  8.   C* c = dynamic_cast<C*>(a);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement