小编Yan*_*ami的帖子

在 C 中转发声明一个结构体

如何转发声明以下treeNodeListCell结构?

我尝试struct treeNodeListCell在结构定义之前编写,但代码无法编译。

有人有想法吗?

struct treeNodeListCell;

typedef struct _treeNode {
    treeNodeListCell *next_possible_positions;
} treeNode;

typedef struct _treeNodeListCell {
    treeNode *node;
    struct _treeNodeListCell *next;
} treeNodeListCell;
Run Code Online (Sandbox Code Playgroud)

c struct forward-declaration

4
推荐指数
1
解决办法
3632
查看次数

标签 统计

c ×1

forward-declaration ×1

struct ×1