gpt4 book ai didi

C结构,指针

转载 作者:太空宇宙 更新时间:2023-11-04 07:36:18 28 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
C : pointer to struct in the struct definition

在我的初学者类(class)中,我们需要为树搜索声明一个结构。我需要在每个节点中引用相同类型的指针。这种声明似乎不正确,在这种情况下 pnode 是未知的。我怎样才能实现我的目标?

typedef struct 
{
int value;
int right;
int left;
pnode nextleft;
pnode nextright;
}node, *pnode;

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com