L
Lilith
I have a class called Intersection which contains the following with
public access...
Intersection operator= (Intersection &i);
It's defined as...
Intersection Intersection:perator= (Intersection &i)
{
this->ID = i.ID;
this->x = i.x;
[snip]
this->se = i.se;
this->ss = i.ss;
this->sw = i.sw;
}
A private method used to clear an array has the following code...
void Intersection::clearLandscape(void)
{
Intersection temp;
for (int j=0; j < 250; j++) {
Landscape[j] = temp;
}
}
Landscape is a static array member of Intersection objects and temp is
an Intersetion object that takes the default constructor.
When I compile I get the following error...
binary '=' : no operator defined which takes a right-hand operand of
type 'class Intersection' (or there is no acceptable conversion)
with regards to the Landscape[j] = temp statement.
Can anyone see where my error is?
public access...
Intersection operator= (Intersection &i);
It's defined as...
Intersection Intersection:perator= (Intersection &i)
{
this->ID = i.ID;
this->x = i.x;
[snip]
this->se = i.se;
this->ss = i.ss;
this->sw = i.sw;
}
A private method used to clear an array has the following code...
void Intersection::clearLandscape(void)
{
Intersection temp;
for (int j=0; j < 250; j++) {
Landscape[j] = temp;
}
}
Landscape is a static array member of Intersection objects and temp is
an Intersetion object that takes the default constructor.
When I compile I get the following error...
binary '=' : no operator defined which takes a right-hand operand of
type 'class Intersection' (or there is no acceptable conversion)
with regards to the Landscape[j] = temp statement.
Can anyone see where my error is?