The principel of a private variable that it is private so it can be affected from outside the object. Normally, the best solution is to create set- and getfunctions, sometimes it's better to make another class a friend. You can learn more about both ways on the tutorial:http://www.cplusplus.com/doc/tutorial/ (Object Oriented Programming)