#include <iostream>
#include <string>
 
struct Base
{
    std::string s = "acid";
    virtual ~Base(){}
    virtual void Print() const
    {
        std::cout << "Base: " << s << std::endl;
    }
};
 
struct Derived : Base
{
    Derived(){ Base::s = "neutral"; }
    virtual ~Derived(){}
    virtual void Print() const
    {
        std::cout << "Derived: " << Base::s << std::endl;
    }
};
 
int main()
{
    std::cout << "sizeof(Base) = " << sizeof(Base) << std::endl;
    std::cout << "sizeof(Derived) = " << sizeof(Derived) << std::endl;

    Base *r1 = new Base;
    Base *r2 = new Derived;
 
    r1->Print();
    r2->Print();
 
    r1->~Base();
    r2->~Base();
    new ((void*)r1) Derived;
    new ((void*)r2) Base;
 
    r1->Print();
    r2->Print();
    
    delete r1;
    delete r2;
}