With a private modifier, why can the member in other objects be accessed directly?
Good question. The point is that protection in C++ is class level, not object level. So a method being invoked on one object can access private members of any other instance of the same class. This makes sense if you see the role of protection being to allow encapsulation to ensure that the writer of … Read more