Is the beginner's tutorial wrong or am I just a newb?

Hey all, excited to start exploring OFx!

I have some experience coding but not too much C++ so pardon if I am just missing something.

the beginners tutorial ends with implementing a move function inside the ball.h class

  
void Ball::moveTo(int _xDestiny, int _yDestiny){    
    x += ( _xDestiny - x )*0.1;    
    y += ( _yDestiny - y )*0.1;    
}    

The tutorial mentions a need to edit the ball.cpp but not specifically HOW to edit it

After some errors I figured out the code needed to recognize that we are passing parameters to the moveTo function and I edited the ball.cpp declaration of

  
void moveTo();  

to

  
void moveTo(int _xDestiny, int _yDestiny);   

and voila it worked.

Obviously it is newbie issue I am having. I have experience with Python where class declarations are somewhat more simplified.

Soooo. My question is whether or not this is the correct way to go about declaring this function in the ball.cpp since I stumbled upon the solution and the tutorial leaves out this detail.

Should the tutorial be updated or is this just a result of my inexperience with C++?

Thank you!

Neither, but I can see why you got confused, for someone learning C++ for the first time is not very clear what to do in that particular sentence, I think the it can be fixed if it says something like:

In Ball.h change the void moveTo() method to

  
void moveTo(int _xDestiny, int _yDestiny);  

And in Ball.cpp change void Ball::moveTo() {} to

  
void Ball::moveTo(int _xDestiny, int _yDestiny){  
    x += ( _xDestiny - x )*0.1;  
    y += ( _yDestiny - y )*0.1;  
}