[cpp]class A
{
public:
A()
{ wcout << _T("A") << endl; }
~A()
{ wcout << _T("~A") << endl; }
};
class B : A
{
public:
B()
{ wcout << _T("B") << endl; }
~B()
{ wcout << _T("~B") << endl; }
};
int _tmain(int argc, _TCHAR* argv[])
{
B b;
return 0;
}[/cpp]
결과
// A -> B -> ~B -> ~A
Leave a Reply
You must be logged in to post a comment.