Inheritance and STL

I'm running into problems when I try to access a multidemensional array,which is of type stl::vector<stl::vector<controlp>> from a derived class. I've temporarily made the superclass's datamembers public to rule out any problems with data hiding from inheritance.

A derived object crashes with "acces violation" when it tries to perform:

get_no_rows();

which is equivalent to

cpoints.size();

If I declare an object of the base class everything works just fine. It's just the derived object that fails.

Not sure about the access violation (what does the stack say?), but I don't think you should be calling the second constructor like that. In the derived class, simply add the base class constructor to the initialization list. In the base class, you should make a separate init function to initialize and move the code that is in surface(int rows, int cols) to the init function.

Not sure if you got this but the other point is that even in a single class you can't call one constructor from another (or from any other function for that matter). That is what the init change was for.