Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class A {public: virtual ~A() = default;};
- class B : public A {};
- class C : public A {};
- int main() {
- A* a = new B();
- C* c = dynamic_cast<C*>(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement