2016-07-27 35 views
0

實施RBtree我試圖實現用C RB樹,但編譯器始終未能就具體錯誤:「提領指向不完全類型」試圖用C

我聲明瞭以下結構:

`typedef struct costumer_tree 
{ 
    int id; 
    char lastName[100]; 
    int color; 
    struct costumers_tree * left; 
    struct costumers_tree * right; 
    struct costumers_tree * parent; 
} 
costumerTree;` 

並使用RBfix功能:

`treeInsertFixup(costumerTree *costumerTreeRoot, costumerTree *z) 
{ 
costumerTree *y; 
while (z->parent->color == 2) 
{ 
...}` 

但是,當我編譯代碼編譯始終未能在該行: while (z->parent->color == 2) 出現錯誤:「提領指向不完全類型」

爲什麼我missong?

感謝,

回答

2

struct costumers_tree從未定義; struct costumer_tree是。

+0

喔羞辱我,我花了一段時間,非常感謝你! –