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 encapsulation in simple terms?
Can a destructor be called directly?
What is overloading in oop?
What is destructor in oop?
Write a program to sort the number with different sorts in one program ??
Can destructor be overloaded?
write a program to find 2^n+1 ?
What are the types of abstraction?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What does enum stand for?
What is class in oop with example?
Why do we use encapsulation in oops?
What is for loop and its syntax?