A DWORD is simply typedef'd to be an unsigned long for shortness.

Note that it's in capitals. There is no such thing (in Windows) as a 
dword.

In Windows the following types are defined:

unsigned int = WORD = 16 bits
unsigned long = DWORD = 32 bits (double word)

Generally, all things in capital letters in Windows programming are 
actually typedef'd to something else.

Mark.


-----Original Message-----
From:   mouss [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, April 25, 2001 4:57 PM
To:     Mark Watts; 'Swapnil Wadikar'; [EMAIL PROTECTED]
Subject:        RE: dword convertion

At 16:22 25/04/01 +0100, Mark Watts wrote:
>A DWORD is actually a data type used in programming. Officially it's 
an
>unsigned long integer which is defined to be 32 bits wide.

I've only seen it used in MS windows environment. never used such a 
concept.
Posix defines many types, and dword is not one of them. so I'll 
continue to
live
without:)


>To convert an IP address to a DWORD you need to do the following:
>
>192.168.100.2
>
>Convert each octet into 8 bit binary:
>
>11000000  10101000  01100100  00000010
>
>now combine them together
>
>11000000101010000110010000000010
>
>and finally convert back into decimal
>
>3232261122

faster:
         192*256^3 + 168*256^2 + 100*256 + 2 = 3232261122

cheers,
mouss
-
[To unsubscribe, send mail to [EMAIL PROTECTED] with
"unsubscribe firewalls" in the body of the message.]

Reply via email to