VC编译出错提示:error C2037: left of ✀rdistance✀ specifies undefined struct⼀union ✀lTree✀

2025-03-04 13:28:18
推荐回答(3个)
回答1:

要么这样写
typedef struct
{
Tree_Type type;
int weight;
int size;
int length;
int ldistance,rdistance;
int min_distance;
lTree *lchild,*rchild;
}lTree,*HBLT;
要么这样写
typedef struct lTree
{
Tree_Type type;
int weight;
int size;
int length;
int ldistance,rdistance;
int min_distance;
struct lTree *lchild,*rchild;
}lTree,*HBLT;

回答2:

typedef用法用错,下面这个网址有详细规范,好好参考
http://wenku.baidu.com/view/e32679dd6f1aff00bed51e3f.html

回答3:

lTree,*HBLT;

怎么在ITree后面多个逗号啊?