Thread: Dword?

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13

    Dword?


    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! :)
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Seattle WA
    Posts
    863
    Rep Power
    14
    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    :confused:
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Seattle WA
    Posts
    863
    Rep Power
    14
    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.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    ok i get it now ty :)

IMN logo majestic logo threadwatch logo seochat tools logo