#include <iostream>
class A
{
std::string k;
int j;
public:
A() { std::cout << "ctor A" << std::endl;};
~A() { std::cout << "dtor A" << std::endl;};
};
class B : public A
{
public:
B() { std::cout << "ctor B" << std::endl;};
~B() {std::cout << "dtor B" << std::endl;};
};
int main()
{
{
std::cout << "building an A obj" << std::endl;
A a;
}
{
std::cout << "building a B obj" << std::endl;
B b;
}
return(0);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgQQp7CiAgICBzdGQ6OnN0cmluZyBrOwogICAgaW50IGo7CiAgcHVibGljOgogICAgQSgpIHsgc3RkOjpjb3V0IDw8ICJjdG9yIEEiIDw8IHN0ZDo6ZW5kbDt9OwogICAgfkEoKSB7IHN0ZDo6Y291dCA8PCAiZHRvciBBIiA8PCBzdGQ6OmVuZGw7fTsKfTsKCmNsYXNzIEIgOiBwdWJsaWMgQQp7CiAgcHVibGljOgogICAgQigpIHsgc3RkOjpjb3V0IDw8ICJjdG9yIEIiIDw8IHN0ZDo6ZW5kbDt9OwogICAgfkIoKSB7c3RkOjpjb3V0IDw8ICJkdG9yIEIiIDw8IHN0ZDo6ZW5kbDt9Owp9OwoKaW50IG1haW4oKQp7CiAgewogICAgc3RkOjpjb3V0IDw8ICJidWlsZGluZyBhbiBBIG9iaiIgPDwgc3RkOjplbmRsOwogICAgQSBhOwogIH0KICB7CiAgICBzdGQ6OmNvdXQgPDwgImJ1aWxkaW5nIGEgIEIgb2JqIiA8PCBzdGQ6OmVuZGw7CiAgICBCIGI7CiAgfQogIHJldHVybigwKTsKfQ==