Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- int x = 1;
- class A {
- public:
- ~A(){
- x = 2
- }
- };
- class B : public A {
- public:
- ~B(){
- x = 3;
- }
- };
- int main() {
- A* foo = new B();
- delete foo;
- std::cout << x;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement