C指针:什么是STRUC * A,*结构A和结构* A之间的区别? [英] C pointers: what's the difference between struc* A, struct *A and struct * A?
问题描述
我正在做一些研究,以更好地理解C指针,但我有一个很难了解这些:
是'结构* A'结构上的指针?
那么什么是'结构* A'?
我也看到有人写'INT常量*了,这是什么意思?
什么是
STRUC * A
,结构* A
和结构* A之间的差异
?
块引用>他们当量(LY错误的)。 C是一种形式自由的语言,空白并不重要。
是
结构* A
结构上的指针?
块引用>没有,这是(仍然)语法错误(
结构
是保留关键字)。如果你在那里替代一个有效的结构名,那么这将是一个,肯定的。
INT常量* A
,这是什么意思?
块引用>本声明
A
是一个指向const int的
。I'm doing some researches to better understand pointers in C, but I'm having a hard time understanding these: Is 'struct* A' a pointer on a structure? Then what is 'struct *A'? And I've seen someone writing 'int const * a', what does this mean?
解决方案what's the difference between
struc* A
,struct *A
andstruct * A
?They're equivalent(ly wrong). C is a free-form language, whitespace doesn't matter.
Is
struct* A
a pointer on a structure?No, it's (still) a syntax error (
struct
is a reserved keyword). If you substitute a valid structure name in there, then it will be one, yes.
int const * a
, what does this mean?This declares
a
to be a pointer toconst int
.这篇关于C指针:什么是STRUC * A,*结构A和结构* A之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!