Status
Not open for further replies.

Official Techie

In the zone
class stationary
{
char type;
char manufacturer[10];
public :
stationary();
void Read_sta_details();
void Disp_Sta_details();
};

class office : public stationary
{
int no_of_types;
float cost_of_sta;
public:
void Read_off_details();
void Disp_off_details();
};

class printer : private office
{
int no_of_users;
char delivery_date[10];
public:
void Read_pri_details();
void Disp_pri_details();
};

void main()
{
printer Myprinter;
}

what is the size of Myprinter in bytes ??
 
OP
Official Techie

Official Techie

In the zone
no no u did not got the point the prog which i had written has come in 2005 board exams how can i write it in computer then i want to know as it is
 

varkey

Journeyman
i think its 30 bytes


edit : its 29 bytes. counted the first char as 2 bytes.
 
Last edited:
OP
Official Techie

Official Techie

In the zone
3 answers which one is correct whats the funda aise hi chalta raha to computer ke exam mein to pakka fail ho jaonga boards mein
 

varkey

Journeyman
as "altimate" said its 29 bytes. eventhough some are private members they are accessible thru the functions which are inherited.
 

mod-the-pc

Back to School Mr. Bean !
varkey said:
as "altimate" said its 29 bytes. eventhough some are private
members they are accessible thru the functions which are inherited.
Yes I tested this and its 29 bytes. But I'm still not sure how the members that are not inherited add to the size of the derived class...:confused:
 
Status
Not open for further replies.
Top Bottom