object initializationan object of a derived class


Object Initialization

An object of a derived class can be initialized to an object of a base class. If both the classes have similar data members, then no specific constructor needs to be explained in the derived class. It uses the constructor of the base class. An object of a base class can be assigned to the object of the derived class, if the derived class doesn't have any additional data members . However, if it does, then the assignment operator will have to be overloaded for the same.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: object initializationan object of a derived class
Reference No:- TGS0309446

Expected delivery within 24 Hours