Lets say I have two classes like the following:
Class A
{
public:
..
private:
int length;
}
Class B: public Class A
{
public:
..
private:
float length;
}
What I would like to know is: 1) Is OVERRIDING OF BASE CLASS DATA MEMBERS allowed? 2) If yes, is it a good practice? 3) If no, what is the best way to extend the type of the data members of a class?
There is a class that satisfies my needs and I want to reuse it. However for my program needs, its data members should be of another type.
I have some books, but all of them refer only to overriding of base class member methods. Thanks everybody in advance.