What happens while a derived-class object is developed, C/C++ Programming

What happens while a derived-class object is developed & destroyed?

A: Space is allocated (on the heap or the stack) for the full object (i.e. adequate space to store the data members inherited from the base class as well as the data members defined in derived class itself)

The constructor of base class is called to initialize the data members which inherited from the base class

Then the derived class's constructor is called to initialize data members added within the derived class

Then the derived-class object is usable

While the object is destroyed (goes out of scope or it is deleted) the derived class's destructor is called on the object first

The base class's destructor is then called on the object lastly the allocated space for the full object is reclaimed

 

Posted Date: 3/16/2013 3:04:25 AM | Location : United States







Related Discussions:- What happens while a derived-class object is developed, Assignment Help, Ask Question on What happens while a derived-class object is developed, Get Answer, Expert's Help, What happens while a derived-class object is developed Discussions

Write discussion on What happens while a derived-class object is developed
Your posts are moderated
Related Questions
Write a function for finding out highest and lowest marks obtained by a student from an array contained student name and marks. For Example : GetHighestLowestMarks{Student{n}, Ma


http://www.expertsmind.com/questions/decodethecode-30110560.aspx

How to Create A Data File? A data file should be created before it can be processed. A stream-oriented data file is able to be created in two ways. One is to create the file st

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

how to fill the blank spaces in the board of 4*4 matrix with the minimum of 4 colors and the condition is the adjacent element should not have the same colour


find area uder the curve y=f(x) between x=a and x=b   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; in

write a program to calculate the cuboid