困惑用typedef和指针用C

困惑用typedef和指针用C

本文介绍了困惑用typedef和指针用C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  

我很困惑与以下内容:

typedef struct body *headerptr;

现在,当我创建类型headptr东西指向一个结构体,创建一个新的headerptr将如下所示(我不知道如果我正确地做这个):

Now, when I create something with type headptr that points to a struct body, to create a new headerptr would be as follows (I'm not sure if I'm doing this correctly):

headerptr newHeadptr;

我是正确的假设,这将是一个指向结构体的指针?

Am I correct to assume that this would be a pointer that points to a struct body?

推荐答案

是的。 headerptr 是相当于现在结构体*

Yes. headerptr is now equivalent to struct body*.

这篇关于困惑用typedef和指针用C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 21:22