【发布时间】:2010-10-09 23:19:45
【问题描述】:
我写 C 的时间不长,所以我不确定我应该如何去做这些递归的事情......我希望每个单元格包含另一个单元格,但我得到一个“字段‘孩子’的类型不完整”的错误。怎么了?
typedef struct Cell {
int isParent;
Cell child;
} Cell;
【问题讨论】:
-
PS 实际上它将“struct Cell”类型定义为“Cell”(这是一种常见模式)
-
他可能正在使用 C++ 编译器。如果真的是 C,他也应该使用 _Bool。
-
如果真的是 C,他应该使用 int :-)
-
为什么? C99 有 bool - 你只需要包含
标签: c recursion struct typedef