Hi All,
Is it possible to store a list of abstract objetcs. For example if i wanted to store a list of vehicles which could consist of cars trucks etc...
public class vehicle // Abstract class
{
void draw() = 0;
}
public class car : public vehicle
{
}
puclic class truc : public vehicle
{
}
Assuming the above, ideally i would like to store a list which can be added to at any point. I was thinking of using a vector stl but cant as cannot instantiate an abstract class
vector<vehicle> vehicleList;
Is there an alternative to doing this?
Cheers