For a project i need getters and setters. The problem is that only when i inizialize my value and set it, the value is correct and updated. But futher use doesn't do anything. The value gets updated with the setter below, but.
Inside of the functions, you don't need to prefix the variables with train::. Also, why are you dereferencing the value at the address of the parameter you pass in, rather than just assigning the value?
currentStation = newCurrentStation;
That would suffice.