When a private constructer is being inherited from one
class to another class and when the object is instantiated
is the space reserved for this private variable in the
memory??

Answer Posted / sanjay makwana, puna

Private Constructor is not inherited.
When private member varible is not inherited but the size is
occupid in dervied class object.

e.g.
#include <iostream.h>
class A
{
int x;
int y;
};

class B : private A
{
};

int main()
{
cout << sizeof(B);
}

output :
8

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is overloading in oop?

577


What is oops and why we use oops?

573


What is difference between multiple inheritance and multilevel inheritance?

603


What is encapsulation process?

582


What is the point of polymorphism?

588






Advantage and disadvantage of routing in telecom sector

788


What are classes oop?

598


What is advantage of inheritance?

690


What are benefits of oop?

639


What are the components of marker interface?

602


why reinterpret cast is considered dangerous?

1903


What is the diamond problem in inheritance?

579


Why polymorphism is used in oops?

585


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

1642


How to use CMutex, CSemaphore in VC++ MFC

4333