Y
Yngve
Hi!
I am trying to make two pointers at instances of the same class wich is
beeing defined. But i get the following error from the compiler (MVC7):
--------------------
c:\Utv\Mana\BinaryTree.h(8) : error C2460: 'BinaryTree::Node::right' : uses
'Bin
aryTree::Node', which is being defined
c:\Utv\Mana\BinaryTree.h(6) : see declaration of 'BinaryTree::Node'
Code below this line: (BinaryTree.h)
//-------------------
class Node; // To tell the compiler that Node exists
class BinaryTree
{
class Node
{
int number;
Node* left, right; // Here is the errorenous line
};
};
// I would really appreciate if someone could help me out here. I thought
that i took
// care of the problem in the first line of the header file (but i didn´t).
I am trying to make two pointers at instances of the same class wich is
beeing defined. But i get the following error from the compiler (MVC7):
--------------------
c:\Utv\Mana\BinaryTree.h(8) : error C2460: 'BinaryTree::Node::right' : uses
'Bin
aryTree::Node', which is being defined
c:\Utv\Mana\BinaryTree.h(6) : see declaration of 'BinaryTree::Node'
Code below this line: (BinaryTree.h)
//-------------------
class Node; // To tell the compiler that Node exists
class BinaryTree
{
class Node
{
int number;
Node* left, right; // Here is the errorenous line
};
};
// I would really appreciate if someone could help me out here. I thought
that i took
// care of the problem in the first line of the header file (but i didn´t).