I have a class that should have a class of the same type as its member.
My declaration is the following:
class clsNode
{
private:
clsNode m_Moth
You can't have a member of the same type inside the class. The compiler tries to calculate the size of the object and sort of "gets into a loop." You can get around that by using indirection. For example, you can store the pointer to the mother node.
class clsNode
{
private:
clsNode* m_Mother;
public:
void setMother(const clsNode &uNode, int index);
};