ashu wrote:
>
> here, the object of base class can't access the member data & functions
> of derived class, as inheritance not work in opposite direction, so
> can't help.
Right. But the base class should not access all of this.
All your base class needs to do is:
make available a couple of virtual functions, which are
implemented in the derived classes.
Eg. The base class introduces functions for handling
of check books. In the 'current account' class, these
functions are fully implemented, while in the 'savings account'
class they are do-nothing-functions (or not implemented at all).
Virtual functions, paired with inheritance is the key to your
assignment!
--
Karl Heinz Buchegger