How I can do it?
I want a constructor of a object to have parameters, this object is inside other class..the compiler say the class dont have proper default constructors..(error C2512)
...
class Game{
private:
Player P1;
Player P2;
public:
Game(void);//constructor
...
class Player{
private:
int x;//player x/y position
int y;
public:
Player(int _x, int _y);//constructor
~Player(void);//destructor
};
...
Player::Player(int _x, int _y){
x = _x;
y = _y;
}
**EDIT**
Also, if I do that:
class Game{
private:
Player P1(10, 210);
Player P2(310, 210);
...
I get "C2059: syntax error : 'constant' "