What makes this struct incomplete?

Posted by Mechko on Stack Overflow See other posts from Stack Overflow or by Mechko
Published on 2010-04-23T05:29:48Z Indexed on 2010/04/23 5:33 UTC
Read the original article Hit count: 321

Filed under:
|
|

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;
}

© Stack Overflow or respective owner

Related posts about c

    Related posts about struct