Можете ли вы объяснить эту ошибку для меня?
В моем файле Ah:
struct TreeNode;
struct TreeHead;
typedef struct TreeNode * Node;
typedef struct TreeHead * Head;
В моем файле Ac:
struct TreeNode {
char* theData;
Node Left;
Node Right;
} ;
struct TreeHead{
int counter;
char type;
Node Root;
};
Head Initialisation() {
Head treeHead;
treeHead = malloc(sizeof (struct TreeHead));
treeHead->Root = malloc(sizeof (struct TreeNode));
return treeHead;
}
В моем Main.cfile:
Head head;
Node tree;
int choose =5;
head = Initialisation();
(head->Root) = tree; //When compiling, this line has an error: error: dereferencing pointer to incomplete type
haed-> Root вернет указатель узла, дерево также является указателем узла.Так почему же ошибка разыменовывает указатель на «неполный» тип?