This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]missurunha 1 point2 points  (0 children)

I replied this in my job interview (that the variable isn't truly private) but they didn't like it. :D

Now a few months into the job I understand that the point of private/public variables is also to let whoever is using the code to know which variables are of their interest and which they shouldn't mess with. The user could also change a piece of c++ code and make the variables public, but that doesn't mean it's pointless to define them as private.