• If we don't define a copy constructor for the derived class, the compiler inserts one that. performs and shallow copy[r]
(1)Session 8-Inheritance(2)
Derived Classes with Depth Multiple Inheritance
(2)Objectives
• Derived Classes with Depth
– Constructors and Destructor – Copy Constructor
– Assignment Operator • Multiple Inheritance
– Virtual Inheritance
• Abstract Base Classes
(3)Derived Classes with Depth
• Constructor(s), copy constructor,
assignment operator and destructor of derived class called ?
(4)(5)Copy Constructor(1)
• A derived class has its own copy constructor
• Derived class copy constructor is distinct from the copy constructor of the base class
• If we don't define a copy constructor for the derived class, the compiler inserts one that
(6)Virtual Operators
• Declaration syntax:
(7)Summary
• Derived Classes with Depth
– Constructors and Destructor – Copy Constructor
– Assignment Operator • Multiple Inheritance
– Virtual Inheritance
• Abstract Base Classes
– Pure Virtual Functions – Abstract Base Classes – Virtual Operators