菜鸟问题

dabie 2008-06-16 01:45:00
typedef struct
{
int m_weight;
int parent;
int lchild;
int rchild;
}structure;

typedef structure* hufmantree;

====================================================
typedef struct
{
int m_weight;
int parent;
int lchild;
int rchild;
}*hufmantree;
两个hufmantree一样吗?
...全文
62 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
typedef struct 
{
int m_weight;
int parent;
int lchild;
int rchild;
}structure;

/* 将1)改成2)应该就一样了!~ */
1)typedef structure* hufmantree; ////////
2)structure *hufmantree;

====================================================
typedef struct
{
int m_weight;
int parent;
int lchild;
int rchild;
}*hufmantree;
两个hufmantree一样吗?

ForestDB 2008-06-16
  • 打赏
  • 举报
回复
不好意思,是我看错了,一样,除了下面的不能声明结构体变量外。
zzzkkk666 2008-06-16
  • 打赏
  • 举报
回复
结论,两种写法是一样的
ForestDB 2008-06-16
  • 打赏
  • 举报
回复
上面的在C编译不过去吧。
typedef struct structure* hufmantree;
shelia910 2008-06-16
  • 打赏
  • 举报
回复
一样
sukyin 2008-06-16
  • 打赏
  • 举报
回复
一样的。都是结构体指针。
yyyapple 2008-06-16
  • 打赏
  • 举报
回复
一样的
晨星 2008-06-16
  • 打赏
  • 举报
回复
一样的吧。

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧