I have a base class Array and a derived class NumericArray
class Array{//Array.h
private: int size;
public: Array();//Default constructor
Array(int index);// Initialize with size
GetSize();//getter function
};
class NumericArray:public Array
{//NumericArray.h
public: NumericArray();//Default constructor
NumericArray(int index);// Initialize with size
};
I know how to call the default Array constructor in NumericArray class. But when it comes to the NumericArray(int index), I have no idea. Since the derived class cannot access the size in base class, I think I should use getter function in base class. But how should I do?
Thanks.