I have the following project, in which I define a main class called frame, and from that class I derive multiple type of classes. The main class "frame" has a protected variable defined as:
class frame {
protected:
char header[4];
}
And in the derived classes I want the array header to have different size, as the following:
class dervied_frame : public frame {
protected:
char header[8];
}
So my question is it possible to override the protected variable in the derived classes? and how to do that?
Note: I don't want to define the header as a pointer and in then in the constructor I define the size that I want through dynamic allocation.