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
Explain the Bitwise-Inclusive-OR Operator: |? The bitwise-inclusive-OR operator (|) contrast each bit of its first operand to the corresponding bit of its second operand and if

Primarily the term alignment refers the tendency of an address pointer value to be a multiple of some power of two. Thus a pointer with two byte alignment contains a zero in the le

WAP TO PRINT THE LARGEST NUMBER FROM ANY 10 NUMBERS #include stdio.h> #include conio.h>   void main()   {                    int a[10],i,max;

padovan string for n natural numbers p(n)=1,p(n)=2,p(n)=3 and use padovan formul to get output 1


Define the Data Type Modifiers in C language? There are three data types(int, float & double) above have the following modifiers. 1. short 2. long 3. signed 4. unsigned

Discuss the saleint featuresand application of c

Integer literal Integer is numbers without fractional parts. e.g. 20       // Decimal 024      // Octal     0x14     // Hexadecimal To indicate long, unsigned,