How to access members of a struct
I have been trying to figure out how to access the members of a struct, but have been unsuccessful. The compiler is generating the error:
"request for member `Element' in something not a structure or union"
The code where this happens is:
Code:
if( X < ( (T->Left)->Element ) )
The struct is defined in a header file as:
Code:
struct AvlNode;
typedef struct AvlNode *AvlTree;
and in the implementation of that header as:
Code:
struct AvlNode
{
int Element;
AvlTree* Left;
AvlTree* Right;
int Height;
};
I have declared an AvlTree object, as a global variable in main() and use extern in the implemenation of another of my header files.
I would greatly appreciate it if someone could point me in the right direction. Thanks.