[email protected]Code:#include<iostream.h>
#include<conio.h>
class A
{
private :
int a;
};
class B : private A
{
};
class C : private B
{
};
void main()
{
C c;
cout<<sizeof(c);
getch();
}
OUTPUT
2
Printable View
[email protected]Code:#include<iostream.h>
#include<conio.h>
class A
{
private :
int a;
};
class B : private A
{
};
class C : private B
{
};
void main()
{
C c;
cout<<sizeof(c);
getch();
}
OUTPUT
2
R u working on Turbo C on Microsoft Windows ????
if yes then the class contains one variable called a thats why class object has 2 bytes in your case otherwise on gcc and on visual studio it will show 4
Because that is what you told it to output. What were you expecting?
Privately derived means the public and procted members of the base class will be treated as the private member in the child class then i think from the above post of mine u can conclude that it will not matter in any way :)
raj.knd - you reported your own post to the moderators to try and get more help. That reporting link is not there for this reason.
Thread Closed.