I have 2 type definitions of structs, ARRAY
and OBJECT
.
ARRAY
has elements in in that are OBJECT
. OBJECT
(when it's TYPE
is COMPLEX
) has array of it's children
enum {
INT,
FLOAT,
STRING,
CHAR,
COMPLEX
} typedef TYPE;
struct {
TYPE type;
ARRAY children;
char name[50];
} typedef OBJECT;
struct {
OBJECT* elements;
int size;
} typedef ARRAY;
I want to create these structs but that's not possible because each one depends on the definition of the other. I get this error:
t.c:11:3: error: unknown type name 'ARRAY'
ARRAY children;
^
1 error generated.