I was just wondering what's the point in using them, maybe there is something about private data handling out of the application that I am not aware of, though. Anyway, I don't see what's the point of having something like this:
So why having an accessor, I think it goes against the encapsulation rule, but anyway my teacher says we should do so... What is good to do... and to know?Code:class x
{
private:
int a;
public:
int Access_A(void)
{
return a;
}
};