Alizaon list 4 execung the body of the derived class

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Ini.alizing the derived class members using the constructor ini.aliza.on list. 4.  Execu.ng the body of the derived class constructor. Review: Sta.c Binding •  The type of implicit parameter determines which of the overriding func.ons to call. •  The type of explicit parameter determines which of the overloading func.ons to call. //class AudioBook: public Book Book a(..); //Book::f(int); //Book::f(string); AudioBook b(…); //AudioBook::f(int); //AudioBook::f(string); a.f(2); //? b.f(“hello”); //? a.f(“hello”); //? b.f(2); //? 1 10/12/12 Sta.c vs. Dynamic Binding •  C++ supports both sta.c and dynamic binding for overriding func.ons calls. •  Dynamic binding only applies to virtual func.ons that are called by object pointers : Func%on calls binding ObjectPointer  ­> virtualFunc.on dynamic Object.virtualFunc.on sta.c ObjectPointer  ­> nonVirtualFunc.on sta.c Virtual Func.on Overhead •  The space overhead...
View Full Document

Ask a homework question - tutors are online