I'm new newbie to c, just finishes few chapters. My question is What is the DWORD data type? For what purpose we use the DWORD data type?
I'm new newbie to c, just finishes few chapters. My question is What is the DWORD data type? For what purpose we use the DWORD data type?
DWORD is stands for a double word. In 16-bit machine word size would be 16 bit But on On a 32-bit machine, it would be 32 bits. And the double word size on 16 bit machine would be 32 bit and on 32bit machine it would be of 64 bit. However, that is very vendor dependent. If you use the 32-bit Microsoft compilers, a WORD and DWORD are the same size!! Since it deals with words, it is meant for low level use for instance bit patterns on an IO chip. If you want high level usage, use unsigned long.
Here is the Double-word data typee explanation form powerbasic.com : Double-words are 32-bit (four byte) unsigned integers with a range of 0 to 4,294,967,295 ( 0 to 2^32-1). The type-specifier character for a Double-word is: ???.
You can also declare Double word variables using the DWORD keyword with the DIM statement. For example: DIM I AS DWORD
As for Word values and Integers, Double-word values have a larger positive range than a Long-integer, and still require only four bytes. Double-word values are useful for indicating absolute memory addresses, such as may be used to store pointer values.
I do believe that, in the Win32 API, 'DWORD' is a 'typedef' for 'unsigned long'. For Information about the underlying C/C++ data types, see Data Type Ranges. And also see this help Windows Data Types .
Bookmarks