What makes this struct incomplete?
- by Mechko
gcc lovingly throws me this error:
bst.c:33: error: invalid application of ‘sizeof’ to incomplete type ‘struct BSTNode’
What makes BSTnode incomplete? Below are the struct definitions relevant to BSTnode.
struct BSTnode{
struct BSTnode * left;
struct BSTnode * right;
struct hash minhash;
struct hash maxhash;
struct DHTid owner;
int misses;
};
where we have:
struct hash{
int hash;
}
struct DHTid
{
int islocal;
unsigned long addr;
unsigned short port;
struct DHTnode * node;
};
and currently:
struct DHTnode{
int something;
}