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
Project Description: We are seeking someone to search mp3 link form audio or m3u8 for videos. Skills required are .NET, C Programming, Engineering, C# Programming

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

How many levels deep can include files be nested? - As such, there is no limit to number of levels of nested include files you can have however your compiler might run out of s

1 Aims The main purpose of the assignment is to let you practice the following programming techniques: perform operations on pointers to basic and more complex types;

What are Arrays? Numerous applications require the processing of multiple data items that have identical characteristics. In such circumstances it is frequently convenient to p

Problem : (a) Stacks can be implemented using arrays. Write down the following C or C++ function to (i) create a stack (ii) add an element to a stack (push). (b) Expl

For this program, you are going to modify your previous program (program 3) so that it will now have a menu to see if the user wants to read the input from a file or interactively.

I am an online tutor who can teach computer science and programming language. Is there any requirement for this?

Class Definition The following is the general format of defining a class template: class tag_name                  {                    public  :               // Must

Aim: To implement a program to convert time in 24 hour format to 12 hour format. Code:                       #include #include #include class time24 {