Overloading a virtual function in a child class

前端 未结 6 1705
一向
一向 2021-01-08 01:04

I am just testing with virtual keyword and inheritance concepts in c++. I have written a small program:

#include
#include

us         


        
6条回答
  •  半阙折子戏
    2021-01-08 01:37

    When you have a function with same name and different parameters in the derived class as that of the base class, then that function will be hidden. You can find more info here..

    You can call the specific hidden function by calling like Base::hiddenFun();

提交回复
热议问题