#include <iostream>
using namespace std;
class CTest
{
public:
CTest() {cout << "CTest Constr\n";}
~CTest() {cout << "DEST CTest\n";}
};
class CTest2:public CTest
{
public:
CTest2() {cout << "Test2 Constr\n";}
~CTest2() {cout << "DEST Test2\n";}
};
int main() {
cout << "main start\n";
{
CTest* hej = new CTest2;
delete hej;
}
cout << "main end\n";
// your code goes here
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCmNsYXNzIENUZXN0CnsKCXB1YmxpYzoKCUNUZXN0KCkJIHtjb3V0IDw8ICJDVGVzdCBDb25zdHJcbiI7fQoJfkNUZXN0KCkge2NvdXQgPDwgIkRFU1QgQ1Rlc3RcbiI7fQp9OwoKCmNsYXNzIENUZXN0MjpwdWJsaWMgQ1Rlc3QKewoJcHVibGljOgoJQ1Rlc3QyKCkJIHtjb3V0IDw8ICJUZXN0MiBDb25zdHJcbiI7fQoJfkNUZXN0MigpIHtjb3V0IDw8ICJERVNUIFRlc3QyXG4iO30KfTsKCgppbnQgbWFpbigpIHsKCgljb3V0IDw8ICJtYWluIHN0YXJ0XG4iOwoJCgl7CgkJQ1Rlc3QqIGhlaiA9IG5ldyBDVGVzdDI7CgkJZGVsZXRlIGhlajsKCX0KCQoJY291dCA8PCAibWFpbiBlbmRcbiI7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglyZXR1cm4gMDsKfQ==