首页 > 代码库 > WORD与DWORD

WORD与DWORD

在VC安装文件夹下有相关的定义。如C:\Program Files\Microsoft Visual Studio\VC98\Include查看头文件WINDEF.H的定义:
typedef unsigned long       DWORD;
typedef int                 BOOL;
typedef unsigned char       BYTE;
typedef unsigned short      WORD;
typedef float               FLOAT;
typedef FLOAT               *PFLOAT;
typedef BOOL near           *PBOOL;
typedef BOOL far            *LPBOOL;
typedef BYTE near           *PBYTE;
typedef BYTE far            *LPBYTE;
typedef int near            *PINT;
typedef int far             *LPINT;
typedef WORD near           *PWORD;
typedef WORD far            *LPWORD;
typedef long far            *LPLONG;
typedef DWORD near          *PDWORD;
typedef DWORD far           *LPDWORD;
typedef void far            *LPVOID;
typedef CONST void far      *LPCVOID;
      从以上定义可以发现,WORD占2个字节,DWORD占4个字节。

WORD与DWORD