Guest User

Untitled

a guest
Jan 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct Parent
  6. {
  7.     ~Parent() { cout << "Parent!\n"; }
  8. };
  9.  
  10. struct Child : Parent
  11. {
  12.     ~Child() { cout << "Child!\n"; }
  13. };
  14.  
  15. int main()
  16. {
  17.     Parent *p = new Child;
  18.  
  19.     delete p;
  20. }
Add Comment
Please, Sign In to add comment