I created a header file including a Node Class and a
NodeList Class.
class Node{
Node* next;
};
class NodeList{
Node* first;
Node* last;
};
I wanna declare a NodeList inside the Node but since
NodeList is declared after Node it gives me this error
class Node{
Node* next;
NodeList list;
};
I get:
error C2146: syntax error : missing ';' before identifier 'list'
error C2501: 'Node::list' : missing storage-class or type specifiers
error C2501: 'Node::NodeList' : missing storage-class or type
specifiers
I tried to include both in different header files with each one
referencing the other but it was a wrose idea since the linker was
looping
Is there any way I can overcome this?
Thank you