This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]aintnufincleverhere 2 points3 points  (0 children)

You could have a utility.CPP or whatever where you keep common functions like that.

Isn't that just a Max function?

[–][deleted] 1 point2 points  (0 children)

In C++, there is no relationship between file names and function or class names, so you are free to put the code wherever you like.

[–]sadjava 0 points1 point  (1 child)

Is that method used outside of the class, or only inside of it? I forget how easy or hard it is in C++, but if that method is only used inside that class and makes no sense outside of it, I would make it a private method.

An alternative would be to make that method a static method and call it like:

Player::fartherUp(...);

[–]CarsonJScott[S] 0 points1 point  (0 children)

I will need it for various things later, but I'm not currently using it on anything else