How large is a DWORD with 32- and 64-bit code?

后端 未结 3 1138
终归单人心
终归单人心 2020-12-01 02:53

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

3条回答
  •  清歌不尽
    2020-12-01 03:28

    It is defined as:

    typedef unsigned long       DWORD;
    

    However, according to the MSDN:

    On 32-bit platforms, long is synonymous with int.

    Therefore, DWORD is 32bit on a 32bit operating system. There is a separate define for a 64bit DWORD:

    typdef unsigned _int64 DWORD64;
    

    Hope that helps.

提交回复
热议问题