Virtual function keyword

后端 未结 2 934
暗喜
暗喜 2021-01-24 10:41

Is there any difference between declaring inherited virtual function in a child class with the \"virtual\" keyword or not, considering I want t

2条回答
  •  醉梦人生
    2021-01-24 11:23

    Keeping the virtual key word before the overridden member function in the derived class is optional. Run-time polymorphism works only for pointers or references.

提交回复
热议问题