What's DWORD?

Posts 1–6 of 6 · Page 1 of 1
What's DWORD?
Ya, I know its some kind of data type but why have I never seen it in any of my c++ books?
its a double word. A word is 2 bytes. So a Dword is 4 bytes.

I'm not completly sure though because doubles are now stored as 64 bits, with the first half in one register and the floating point value in another 32bit register.
You don't see them in books because they are a part of the Windows API.
A WORD is an unsigned short
A DWORD is an unsigned long.

Microsoft used typedef to define aliases for unsigned short and long. So if you type it into visual C++ and you have included windows.h, then you can see what it actually is. Though strangely enough if you search for it, sometimes i see DWORD as unsigned int. But it makes no differences since i'm pretty sure, in VC++ atleast and int and a long are the same size
Bit = 1 bit
Nibble = 4 bit
Byte = 8 Bits
Word = 2 bytes; 16 Bits; (unsigned short on a 32 bit platform; unsigned Int on 16bit platform)
DWord = 4 bytes; 32 bits; (unsigned Int on a 32 bit platform; unsigned long on a 16 bit platform
QWord = 8 Bytes; 64 Bits (unsigned long on 32 bit platform; )
Quote Originally Posted by zeco View Post
in VC++ atleast and int and a long are the same size
int = 32bit and long is 64 bit
Ya.. and this is why I love you guys.

Edit: So Bit, Nibble, Bite, WORD, DWORD, and QWORD are all part of windows api and can only be used with the windows header file?

Also, can't I accomplish the same thing with an unsigned short (for a 32bit platform) insteand of WORD?
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?