how can we make resize function for Matrix2 Class in c++ ?

class Matrix1
{

Protected:
int ** data;
int row,col;
Public:

};
Class Matrix2 : Public Matrix
{
Public:
Matrix2()
{

}
void resize()
{
//??????
}

};
// How can we write resize function for Matrix2 class; where this function need to use Protected data members of matrix1 class?
Only setters are available in Matrix 1 class but there is no getter function in Matrix1 class !



Derived class has access to protected members of its base class. So you can directly access data members of class Matrix1 inside class Matrix2.
Topic archived. No new replies allowed.