I want to make an argument for one of the member functions optional. When no argument is provided, it would use an member variable.
However, when I tried to compil
You can overload your function member like that:
void Object::MoveTo(double speed, Point position) { .... } void Object::MoveTo(double speed) { Point position = this->initPos; MoveTo(speed, position); }