inheritance in c++
hello everyone!
my question is when we inherit a base class say B privately through a derived class say D, the public and protected members of base class become private members for derived class,alright. but in such a way the public members of derived class should be able to access the public members of base class(since they are now private members for derived class) and since public members of one class can access its private members,the derived class member function should be able to access private members of base class through public members of base class,but code is not working.
i don't where is the problem.i think the way i am calling a base class' function inside derived class' has some error.i attached the file please give your valuable comments
my question is when we inherit a base class say B privately through a derived class say D, the public and protected members of base class become private members for derived class,alright. but in such a way the public members of derived class should be able to access the public members of base class(since they are now private members for derived class) and since public members of one class can access its private members,the derived class member function should be able to access private members of base class through public members of base class,but code is not working.
i don't where is the problem.i think the way i am calling a base class' function inside derived class' has some error.i attached the file please give your valuable comments
0