September 28th, 2002, 06:19 PM
Hi Im sorta a C++ Newbie as you might know, but i was wondering what DWORD did. In most code I see there is DWORD watever; can someone please explain to me what this does? Thanks! :)
September 28th, 2002, 06:49 PM
I believe DWORD stands for 'double word.' A word is a two byte variable, so a double word is a four byte variable. What you have is a 32 bit unsigned integer.
September 30th, 2002, 08:41 PM
October 1st, 2002, 06:09 PM
Well it's a data type. No different from an integer (int) or a character (char).
1 byte = 8 bit.
1 word = 2 byte = 16 bit.
1 dword = 2 word = 4 byte = 32 bit.
A bit is a single digitial unit, usually noted as 0 or 1. So, a DWORD is 32 of these bits, with a range starting from
0000 0000 0000 0000 0000 0000 0000 0000
and going to
1111 1111 1111 1111 1111 1111 1111 1111
which in decimal is the range 0 to 4 294 967 295 (2^32). Imagine a DWORD as a simple unsigned integer (only whole numbers, where there is no information if the number is greater than or less than zero). In this case, it would have the ability to hold numbers between 0 and ~4.3 billion. There are other uses for DWORDS, how you use them is up to your program.
October 2nd, 2002, 12:52 AM