J
Josh McFarlane
I'm making a basic classes.
(snipped for simplicity)
class CWLRecord //Base Record Class
{
private:
CWLRecord *pNextRecord ; //Pointer to next record
} ;
then I take this base record class and define a record for each
different set of data I have. However, I want to make sure that when I
create an instance of the derived class CWLRecord_Foo, instead of
pNextRecord being a pointer of type CWLRecord, I want it class
CWLRecord_Foo to require a pointer of type CWLRecord_Foo. However, I
want to still be able to use functions from CWLRecord (such as WipeAll,
RetrieveNext, etc) to be able to use pNextRecord as a generic
CWLRecord. Can I do
class CWLRecord_Foo : public CWLRecord
{
private:
CWLRecord_Foo *pNextRecord
};
and have it work in the way I'd like it to? I just want to make sure
I'm not doing something fundamentally wrong.
Thanks,
Josh McFarlane
(snipped for simplicity)
class CWLRecord //Base Record Class
{
private:
CWLRecord *pNextRecord ; //Pointer to next record
} ;
then I take this base record class and define a record for each
different set of data I have. However, I want to make sure that when I
create an instance of the derived class CWLRecord_Foo, instead of
pNextRecord being a pointer of type CWLRecord, I want it class
CWLRecord_Foo to require a pointer of type CWLRecord_Foo. However, I
want to still be able to use functions from CWLRecord (such as WipeAll,
RetrieveNext, etc) to be able to use pNextRecord as a generic
CWLRecord. Can I do
class CWLRecord_Foo : public CWLRecord
{
private:
CWLRecord_Foo *pNextRecord
};
and have it work in the way I'd like it to? I just want to make sure
I'm not doing something fundamentally wrong.
Thanks,
Josh McFarlane