Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Base
- {
- public:
- Base()
- {
- std::cout << "Base()\n";
- }
- ~Base()
- {
- std::cout << "~Base()\n";
- }
- };
- class Derived: public Base
- {
- public:
- Derived()
- {
- std::cout << "Derived()\n";
- }
- ~Derived()
- {
- std::cout << "~Derived()\n";
- }
- };
- int main()
- {
- Derived d;
- Base b;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement