的Visual C ++:如何大的是32位和64位code的DWORD? [英] Visual C++: How large is a DWORD with 32- and 64-bit code?

查看:242
本文介绍了的Visual C ++:如何大的是32位和64位code的DWORD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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.

您可以在这里找到的官方列表: <一href="http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx">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).

这篇关于的Visual C ++:如何大的是32位和64位code的DWORD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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