我正在尝试在 C 中构建一个基本的链表。我似乎收到此代码的错误:
typedef struct
{
char letter;
int number;
list_t *next;
}list_t;
char letters[] = {"ABCDEFGH"};
list_t openGame, ruyLopez;
openGame.letter = letters[4];
openGame.number = 4;
openGame.next = &ruyLopez;
ruyLopez.letter = letters[5];
ruyLopez.number = 4;
ruyLopez.next = NULL;
它不会接受我在结构中的定义:
list_t *next;
出于同样的原因,它不会接受:
openGame.next = &ruyLopez;