2 classes base class - A & derived - B .How to access private member(n) which is declared in A to B as A::n | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

2 classes base class - A & derived - B .How to access private member(n) which is declared in A to B as A::n

3rd Sep 2017, 9:51 AM
Pratiksha Chikhale
Pratiksha Chikhale - avatar
2 Answers
+ 1
If you want to access it, why is it private?
3rd Sep 2017, 1:33 PM
Bagshot
Bagshot - avatar
0
Either B inherit from A or B is a friend class of A (both ways are well explained in the C++ course of Sololearn)
3rd Sep 2017, 10:45 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar