Situation: there is an abstract class (names from the bald) Father, the class Sister inherited from it and just the class Child. In Child there is a Father * mom, in which the constructor writes the address of Sister. Father has a pure virtual method getName (), which is overridden in Sister. Question: how can I from Child call the Sister's getName () method, say from some foo () method?
void foo() { mom->getName(); //не сработает, и если указать Mom::, даже если есть доступ }
If not, then how is it possible? And what are the alternatives? Thank!