gpt4 book ai didi

C 指针 : what's the difference between struc* A, struct *A 和 struct * A?

转载 作者:行者123 更新时间:2023-11-30 18:19:10 25 4
gpt4 key购买 nike

我正在做一些研究以更好地理解 C 中的指针,但我很难理解这些:'struct* A' 是结构体上的指针吗?那么什么是“struct *A”呢?我看到有人写“int const * a”,这是什么意思?

最佳答案

what's the difference between struc* A, struct *A and struct * A?

它们是等价的(错误的)。 C 是一种自由格式语言,空格并不重要。

Is struct* A a pointer on a structure?

不,它(仍然)是一个语法错误(struct 是保留关键字)。如果您在其中替换一个有效的结构名称,那么它将是一个,是的。

int const * a, what does this mean?

这将 a 声明为指向 const int 的指针。

关于C 指针 : what's the difference between struc* A, struct *A 和 struct * A?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15981068/

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