Class in function argument?

Hey, I've got two classes, a sprite class and a player class. I'm trying to pass in the Sprite class to use in the player class. For example, I have Sprite Player which is a sprite, and in the player class I want to say Player.x = 5. The player class doesnt know what Player.x is so I used this:

1
2
3
4
5
6
7
class player
{
//class stuff
void move(SpriteClass & val)
{
   val.x = 3;
}

I'm getting errors with this though. Overloaded member function not found in 'player"

Any help?
Show the complete error message, please.
These are the two that are shown:

syntax error : identifier 'SpriteClass'
'void player::move(SpriteClass &)' : overloaded member function not found in 'Player'
Last edited on
Show if possible the two classes, and show the line of code that calls player::move().
Nothing calls player move yet. All the player class has in it is the constructor/deconstructor and void move.
what is compleate code .
'void player::move(SpriteClass &)': overloaded member function not found in 'Player'


In the beginning you have "player" all in lowercase, and at the end you have it capitalized. That could have something to do with it, but it's impossible to be sure unless you post some more code.

The other code is fine, the only line in my entire code that it doesnt like is the void move(SpriteClass & val).
Fine, but can you show some more code? If it's complaining about a line, and everything looks fine on that line, it's probably somewhere else.
Last edited on
Topic archived. No new replies allowed.