I know this question is getting old, but I can't seem to understand what's wrong with my code.
I have a tree.c
file with the following struct tree
, and this file includes a header file in which is declared a pointer to this type of struct:
tree.c
#include "tree.h"
typedef struct tree
{
char desig[200];
int num;
tree_ptr left, right, subtree;
} Tree;
tree.h
#ifndef ___TREE_H___
#define ___TREE_H___
typedef struct tree *tree_ptr;
#endif
When I try to access some instance of this struct in another source file, the compiler gives me the "dereferencing pointer to incomplete type" error:
insert(..., instance->subtree);
What's wrong?