write a program to demonstrate,how constructor and
deconstructor work under multilevel inheritance
Answer Posted / archana
class a
{
//Data
public:
a(){cout<<"class A Constructor"<<endl}
~a(){cout<<"class A Destructor"<<endl}
};
class b:public a
{
//Data
public:
b(){cout<<"class B Constructor"<<endl}
~b(){cout<<"class B Destructor"<<endl}
};
class c:public b
{
//Data
public:
c(){cout<<"class C Constructor"<<endl}
~c(){cout<<"class C Destructor"<<endl}
};
int main()
{
c *pCObj;
pCObj = new c();
return 0;
}
O/p:
class A Constructor
class B Constructor
class C Constructor
class C Destructor
class B Destructor
class A Destructor
Is This Answer Correct ? | 8 Yes | 9 No |
Post New Answer View All Answers
What is a standard template library (stl)? What are the various types of stl containers?
What is a standard template library (stl)?
What are the various types of stl containers?
sir please send me bpcl previous question papers
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase
What does stl stand for in basketball?
To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command
What two types of containers does the stl provide?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
What are the symptoms of stl?
What is a list in c++ stl?
totoo po ba ang manga aliens!
Why should a c++ programmer be interested in stl?
What are the different types of stl containers?