0% found this document useful (0 votes)
27 views1 page

Question 1 B

Protected members can be accessed by derived classes while private members cannot be accessed directly by any other class except friend functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

Question 1 B

Protected members can be accessed by derived classes while private members cannot be accessed directly by any other class except friend functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Question 1 b):

i) protected member are most suitable in class A and C. Class C can access protected member in class A while class D and E have the same base in Class C. Protected members can be accessed in derived classes from a base class.

ii) No class can access private member of class C directly because private members neither can be access nor viewed when outside the class except for friend function.

You might also like