How do we access the private member variable outside the class with out using friend ?
Friend class - private member variable
Collapse
X
-
Tags: None
-
-
-
Of course, providing access to the private member breaks encapsulation. That means you can no longer rely on the member functions to protect the values in the data member. So, if the value get screwed up your list of suspects exopands from just the member functions to all the function in program that can touch that data member directly or indirectly.Comment
Comment