i have doubts regarding the use of classes.please explain to me with an example.
Printable View
i have doubts regarding the use of classes.please explain to me with an example.
Code:class POSITION
{
public:
POSITION();
POSITION(int X, int Y);
int GetX();
int GetY();
void SetX(int X);
void SetY(int Y);
void SetPosition(int X, int Y);
private:
int Xpos;
int Ypos;
};
int main()
{
POSITION PlayerPosition(120, 450);
POSITION EnemyPosition(200, 180);
...
return 0;
}