Accessor and mutator functions (a.k.a. set and get functions) provide a direct way to change or just access private variables.
They must be written with the utmost care because they have to provide the protection of the data that gives meaning to a class in the first place. Remember the central theme of a class: data members are hidden in the private section, and can only be changed by the public member functions which dictate allowable changes.