35 How to access private members of the class | C++ Programming Tutorial for beginners | cpp | C plu

Опубликовано: 12 Март 2021
на канале: tech fort
92
1

#How to access private methods/functions of derived class:
-----------------------------------------------
Ans: using virtual keyword

Programmer can call private function of derived class from the base class pointer with the help of virtual keyword. Compiler checks for access specifier only at compile time. So at run time when late binding occurs it does not check whether we are accessing/calling the private functions or public functions.