If I have a class defined like this:
And then I go to define the function move(), this seems to work fine:Code:class Sprite {
public:
int xpos;
int ypos;
void move();
};
But I was wondering how you distinguish between the class variable Sprite.xpos and a global variable xpos if you have one. If it's inside a class definition does it always assume you're talking about the class variable?Code:Sprite::move() {
xpos = xpos++;
ypos = ypos++;
};