Unit 13-Polymorphism Virtual Functions课件.pptVIP

  • 2
  • 0
  • 约2.84万字
  • 约 88页
  • 2017-08-10 发布于广东
  • 举报
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Calls up the chain You can still call the overridden function: void Derived::func() { cout In Derived::func!; Base::func(); // call to base class } This is a common way to add new functionality No need to copy the old stuff! * Overloading and virtuals Overloading adds multiple signatures class Base { public: virtual void func(); virtual void func(int); }; If you override an overloaded function, you must override all of the variants! Cant override just one If you dont override all, some will be hidden * overloading overriding #

文档评论(0)

1亿VIP精品文档

相关文档