what are the advantages (if any) to declaring variables in classes private/protected? like, say you had a player class (for some sort of game), you would have...
if you can set and get the variable health, why not just have health public?Code:class Player { public: void setHealth(int); int getHealth(); private: int health; };
just curious...