这个电话的类型是什么? [英] what is the type for this call?

查看:96
本文介绍了这个电话的类型是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有:

typedef struct str32 {

uint32_t word1;

uint32_t word2;

} word_array;


word_array * my_array;


这是什么数据类型:

myarray- > word1

为什么它是uint32_t类型并且给出了word1的值?不是吗?b $ b它还是一个没有被解除引用的指针吗?

我以为我应该做*(my_array-> word1)才能到达

uint32_t类型,怎么回事?

If i have a :
typedef struct str32{
uint32_t word1;
uint32_t word2;
} word_array;

word_array *my_array;

what would be the data type of this:
myarray->word1
How come it is a uint32_t type and is giving the value of word1? isn''t
it still a pointer which is not dereferenced yet?
I was thinking I should have to do *(my_array->word1) to get to
uint32_t type, what goes?

推荐答案

Neo写道:
Neo wrote:

如果我有:

typedef struct str32 {

uint32_t word1;

uint32_t word2;

} word_array;
If i have a :
typedef struct str32{
uint32_t word1;
uint32_t word2;
} word_array;



(你为什么要将结构称为str32而类型为word_array?

这两个名字似乎都不合适关系很脆弱。)

(Why are you calling the struct a "str32" and the type "word_array"?
Neither name seems appropriate and their relationship is tenuous.)


word_array * my_array;


这是什么数据类型:

myarray-> word1
word_array *my_array;

what would be the data type of this:
myarray->word1



unint32_t。

unint32_t.


为什么它是uint32_t类型并给出word1的值?
How come it is a uint32_t type and is giving the value of word1?



你将`word1`声明为unint32_t,这就是'它是什么。

You declared `word1` as a unint32_t, so that''s what it is.


难道它还不是一个没有被解除引用的指针吗?
isn''t it still a pointer which is not dereferenced yet?



No.

No.


我以为我应该做*(my_array-> word1)得到

uint32_t类型,怎么回事?
I was thinking I should have to do *(my_array->word1) to get to
uint32_t type, what goes?



`A-> B`是`(*(A.B))`;箭头已经为你做了解除引用。


-

" 2008就是这一切都改变了,你必须做好准备。 " Unsaid / Torchwood /

Hewlett-Packard Limited注册办事处:Cain Road,Bracknell,

注册号:690597 England Berks RG12 1HN

`A->B` is `(*(A.B))`; the arrow has done the dereference for you.

--
"2008 is when it all changes, and you''ve got to be ready." Unsaid /Torchwood/

Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN


Neo写道:
Neo wrote:

如果我有:

typedef struct str32 {

uint32_t word1;

uint32_t word2;

} word_array;


word_array * my_array;


这将是什么数据类型:

myarray-> word1

为什么它是uint32_t类型并且正在给予word1的值?不是吗?b $ b它还是一个没有被解除引用的指针吗?

我以为我应该做*(my_array-> word1)才能到达

uint32_t类型,怎么回事?
If i have a :
typedef struct str32{
uint32_t word1;
uint32_t word2;
} word_array;

word_array *my_array;

what would be the data type of this:
myarray->word1
How come it is a uint32_t type and is giving the value of word1? isn''t
it still a pointer which is not dereferenced yet?
I was thinking I should have to do *(my_array->word1) to get to
uint32_t type, what goes?



据我所知,你使用(* my_array).word1或my_array-> word1。

括号需要优先。

To my understanding either u use (*my_array).word1 or my_array->word1.
Parenthesis are need for precedence.


Chris Dollin写道:
Chris Dollin wrote:

`A-> B`是`(*(AB))` ;箭头已经为你取消引用。
`A->B` is `(*(A.B))`; the arrow has done the dereference for you.



B不是指针,所以我认为你的符号是错误的。

你应该使用(* A).B而不是

B is not a pointer, so I think your notation is wrong.
you should use (*A).B instead


这篇关于这个电话的类型是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆