谢谢你们的陪伴 英文:虚函数是什么?

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/10 14:37:33
实现机制,作用

A virtual function is a member function that you expect to be redefined in derived classes. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class's version of the function.

就是如果你想用这个函数就必须自己实现!由系统调用!