gpt4 book ai didi

c++ - 转发声明未命名结构的 typedef

转载 作者:可可西里 更新时间:2023-11-01 18:19:05 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Forward declarations of unnamed struct

如果我有

typedef struct tagPAGERANGE
{
int iFirstPage;
int iLastPage;
} PAGERANGE;

我可以这样转发声明

struct tagPAGERANGE;
typedef struct tagPAGERANGE PAGERANGE;

但是我有的是

typedef struct
{
int iFirstPage;
int iLastPage;
} PAGERANGE;

我不确定我该怎么做。我只想持有指向该结构的指针。现在我坚持要么包含一个相当大的标题,要么复制结构的定义。

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