的Visual C ++:如何大的是32位和64位code的DWORD?的是、Visual、DWORD、code

2023-09-08 09:57:33 作者:斩尽天下

在Visual C ++中的DWORD只是一个无符号长即机,平台和SDK依赖。然而,由于DWORD是一个双字(即2 * 16),是一个DWORD仍然在64位架构的32位?

In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures?

推荐答案

其实,在32位计算机一个字是32位的,但DWORD类型是从16位的好时光遗留下来的。

Actually, on 32-bit computers a word is 32-bit, but the DWORD type is a leftover from the good old days of 16-bit.

为了以更容易地移植程序的较新的系统中,微软已决定所有旧类型不会改变大小

In order to make it easier to port programs to the newer system, Microsoft has decided all the old types will not change size.

您可以在这里找到的官方列表: http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx

You can find the official list here: http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx

所有这一切的转变改变了从32位到64位,且_Ptr结束依赖于平台的类型(DWORD_PTR将在32位Windows和64位Windows 64位32位)。

All the platform-dependent types that changed with the transition from 32-bit to 64-bit end with _PTR (DWORD_PTR will be 32-bit on 32-bit Windows and 64-bit on 64-bit Windows).

 
精彩推荐
图片推荐