Created
January 25, 2012 16:35
-
-
Save bradtgmurray/1677112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[bmurray@bmurray-pc3-linux-vm crap]$ g++ test.cpp && ./a.out | |
Cprime | |
B | |
A | |
[bmurray@bmurray-pc3-linux-vm crap]$ cat test.cpp | |
#include <stdio.h> | |
class A | |
{ | |
public: | |
virtual ~A() { printf("A\n"); } | |
}; | |
class B : public A | |
{ | |
public: | |
~B() { printf("B\n"); } | |
}; | |
class Cprime | |
{ | |
public: | |
~Cprime() { printf("Cprime\n"); } | |
}; | |
class C : public B, public Cprime | |
{ | |
public: | |
// Default destructor | |
}; | |
int main() | |
{ | |
A* c = new C(); | |
delete c; | |
return 0; | |
} | |
[bmurray@bmurray-pc3-linux-vm crap]$ g++ test.cpp && ./a.out | |
Cprime | |
B | |
A | |
[bmurray@bmurray-pc3-linux-vm crap]$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment