Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Parent
- {
- ~Parent() { cout << "Parent!\n"; }
- };
- struct Child : Parent
- {
- ~Child() { cout << "Child!\n"; }
- };
- int main()
- {
- Parent *p = new Child;
- delete p;
- }
Add Comment
Please, Sign In to add comment