class MB { virtual void ShowMessage() { } }; class MA { MB obj; public: void PrintMessage() { obj.ShowMessage() } };
class WA : public MB { virtual void ShowMessage() override { } }; class WB { WA wObj; void GetData() { wObj= new MB(); wObj.PrintMessage(); } };
Class MC { void PrintMessage() { } };
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)