+ 1
What's the best practices of changing a property of a class from another class?
I used to declare them public static but this makes it accessible from anywhere
1 Resposta
+ 2
One way is to create member functions which do the required changes to the data members(also known as mutator function).
Or if you want them to be accessible in one specific class only then declare them as *protected* and let the other class inherit the original class.