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
What is overloading in oop?
What is oops and why we use oops?
What is difference between multiple inheritance and multilevel inheritance?
What is encapsulation process?
What is the point of polymorphism?
Advantage and disadvantage of routing in telecom sector
What are classes oop?
What is advantage of inheritance?
What are benefits of oop?
What are the components of marker interface?
why reinterpret cast is considered dangerous?
What is the diamond problem in inheritance?
Why polymorphism is used in oops?
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).
How to use CMutex, CSemaphore in VC++ MFC