I've got a Car class and a Track class. The Car class constructor takes a road parameter which is supposed to be a 32x32 boolean array. Then I've got a Track class which creates a Car class and is supposed to pass the 32x32 array to it's constructor.
Note that I've simplified the code somewhat by removing irrelevant bits and pieces.
class Car : public WorldObject
{
private:
bool _road[32][32];
public:
Car(bool road[32][32])
{
_road = road;
}
};
class Track : public WorldObject
{
public:
bool _road[32][32];
Track()
{
Car* _car = new Car(this->_road);
_car->Position.X = 50;
_car->Position.Y = 50;
ChildObjects.push_back(_car);
}
};
This won't compile ... I get an error:
Error 1 error C2440: '=' : cannot convert from 'bool [][32]' to 'bool [32][32]'
in the the _road = road; line in the Car constructor.
What am I doing wrong?