【发布时间】:2013-12-07 18:07:29
【问题描述】:
我收到一个关于结构元素的错误。
struct trie {
char ch;
bool isEnd;
struct trie arr[4];
struct trie *next;
};
错误:
error: field ‘arr’ has incomplete type
【问题讨论】:
-
你必须转发声明
trie。否则当它试图在结构中使用自己时它的类型不完整 -
@amdixon 不会解决问题。
struct不能包含自己。 -
所以你的 trie 包含四个尝试,每个尝试包含四个尝试,每个尝试包含四个尝试,....
标签: c