I'm trying to get my head around why I can't overwrite a subclass object with another subclass object if they share base class.
Say that Letter is the base class. A and B are subclasses. The following doesn't seem to work:
Letter* a_p = new A();
Letter* b_p = new B();
delete a_p;
*a_p = *b_p;
My ambition is to change what is located at a certain adress so that all pointers to the adress in question changes what they point to. In the above example, I'd like to somehow change the "content" of a_p to a copy of the "content" of b_p.
Is this possible somehow?