gpt4 book ai didi

c++ - 这是什么意思?这是关于c++中的DWORD变量

转载 作者:行者123 更新时间:2023-11-30 20:00:55 24 4
gpt4 key购买 nike

代码:

BYTE arBytes[4096];

//write to the arBytes,so the arBytes already not null,then read continue

DWORD* pdw;

pdw=(DWORD*)&arBytes[0];

if(pdw[0]==dwValue) //here is what I what to ask
//some operate
}

我的问题是:pdw[0] 是什么意思?它是一个 DWORD* 变量,dwValue 也是一个 DWORD 值。如果能指出代码的含义就更好了。

最佳答案

对于:

type* identifier;

取消引用可以通过两种方式完成:

  • *标识符 - 指针方法
  • 标识符[0] - 数组方法

因为数组样式的操作是为指针定义的。所以:

identifier[0] is the same as *(identifier+0) which is indeed *identifier

回答你的问题:

pdw[0] 只是 *pwd,它是一个 DWORD 值

关于c++ - 这是什么意思?这是关于c++中的DWORD变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38346166/

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