[问题] 有关于typedef省略的问题?

楼主: cat99961 (阿汤)   2020-05-11 14:37:18
1. #include <stdlib.h>
2. #include <stdio.h>
3. struct tree /* 树的结构宣告 */
4. {
5. int data; /* 节点资料 */
6. struct tree *left; /* 指向左子树的指标 */
7. struct tree *right; /* 指向右子树的指标 */
8. };
9. typedef struct tree treenode; /* 树的结构新型态 */
10.typedef struct tree *btree; /* 宣告树节点指标型态 */
/*
作者: b0920075 (Void)   2020-05-11 14:45:00
insert node 那边你把 btree 当 data type 了吧
作者: shadow0326 (非议)   2020-05-11 14:45:00
删掉之后btree就是一个variable,不是一个type所以11行就gg
作者: chuegou (chuegou)   2020-05-11 21:08:00
就...unknown type name ‘btree’ 没有btree这个型别阿

Links booklink

Contact Us: admin [ a t ] ucptt.com