Jump to content

[SOLVED] Vector of Base class does not append child Class


photo

Recommended Posts

Posted

Hi,

 

I have a base class called Car.

 

From Car class I have derived p21c class.

 

Then I define a vector: 

 

Car cars[];

 

child = createEntity("p21c");

cars.append(child);

 

When I try to append a child class to this vector in log file it says:

 

 Variable::operator<(): bad operands int and user class

 

SOLVED: changing cars.append to car[1] = p21 worked

×
×
  • Create New...