Hi,

I'm having an issue trying to pass a vector to a function.

The function parameter is of vector<base_class>, then I'm actually passing vector<sub_class>, but it doesn't work.

Is it possibly to do this in C++?

Here's more specific code

Code:

void drawRectangles(vector <Rectangle> v) {
// do whatever in here
}

// some other place is calling
vector <Building> buildings;

// populate that
drawRectangles(buildings);


// Buildings looks like

class Building : public Rectangle ....
Thanks