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

标签 c++ c windows

代码:

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/

相关文章:

windows - Window 的命令行 (cmd.exe) 命令的最大长度是多少?

python - 为什么我在图片上添加评论后图片的尺寸会变小?

windows - 在 Windows 机器上运行 Ansible 时出现 "Undefined variable"错误

c++ - 使用 `reinterpret_cast` 调用非静态成员函数而不实例化

c++ - 可以从此函数中删除递归吗?

将 atmega 32 代码转换为 atmega 16 代码

C: MSVC2008 Malloc 和崩溃程序

c++ - std::list 实现和指针算法。

c++ - 在 C++ char 数组中打印元音

c - 附加到进程是否会使其行为不同?