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
b) The static keyword let a variable to maintain its value among distinct function calls. If the value of a static variable alters while the variable has been accessed, variable

Aim: To implement a program for dynamic data structure(linked list). Code:                       class node {             int data;             node *next;

Poker Room auto seat program Project Description: I want a script for an online poker site. It requires to be scanning all the available tables and when the table meets certa

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

I really have a hard time analyzing how to write a code in C. It''s all bout Time Departure and we must used a 24 hour clock. Can u help me?

You're going to simulate a metropolitan subway train.  The train system will start out at Station #1, or Home  Station, and will service multiple stations along its route.

BACKGROUND: FILE SYSTEMS  In a computer, a file system (sometimes written filesystem) is the way in which files are named and where they are placed logically for storage and ret

write a program to calculate the cuboid

i didnt no how to write and how to implement and the programming can be done in C and execution should be done in UNIX

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.