I have a class called player and the member function move. In move, there is a function that needs the player as an argument. How can I pass the player itself as an argument to the function???
Printable View
I have a class called player and the member function move. In move, there is a function that needs the player as an argument. How can I pass the player itself as an argument to the function???
Sounds like you want to pass an object of the player class as an argument.
Yeah, how can I do it?
assuming the function is setup for that, you can use the this keyword or *this
Thanks Joeman, th is exactly what I wanted :)
Is move static? Why else would an object need to pass the this pointer to one of its own member functions?
It was passing it to an outside function via the member function, but the issue is solved now.