Inheritance with a linked list
Hello All
I'm new to C++ so I was hopping you could help me out. I'm trying to do
a double linked list and I'm not sure what to do when I inherit from the
linked item. Given the following:
class cBox
{
cBox *Next, *Prev; // Linked list
public:
cBox();
~cBox()
};
class cShoeBox : public cBox
{
public:
cShoeBox();
~cShoeBox()
}
In cShoeBox can I use Next and Prev from the ancestor and assign a
cShoeBox to them or do I have to redefine Next and Prev as cShoeBox? If
I have to redefine them can I still call them Next and Prev or do I have
to change their names as well to say Next1 and Prev1? No matter what the
answer is I want to understand why. Please give me as much detail as you
can. Thank you!