#include using namespace std; class A { private: int value; public: A(int init):value(init){} void changevalue(A &am
Because class access specifier apply on per class basis and not per object basis.
You can always modify the same type of object inside the class functions.Usual examples are copy constructor and copy assignment operator.