Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
September 28th, 2002, 07:19 PM
 Optix
Contributing User

Join Date: Jun 2002
Posts: 36
Time spent in forums: < 1 sec
Reputation Power: 12
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
September 28th, 2002, 07:49 PM
 MJEggertson
Contributing User

Join Date: Jan 2002
Location: Seattle WA
Posts: 863
Time spent in forums: 22 sec
Reputation Power: 13
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.

#3
September 30th, 2002, 09:41 PM
 Optix
Contributing User

Join Date: Jun 2002
Posts: 36
Time spent in forums: < 1 sec
Reputation Power: 12

#4
October 1st, 2002, 07:09 PM
 MJEggertson
Contributing User

Join Date: Jan 2002
Location: Seattle WA
Posts: 863
Time spent in forums: 22 sec
Reputation Power: 13
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.

#5
October 2nd, 2002, 01:52 AM
 Optix
Contributing User

Join Date: Jun 2002
Posts: 36
Time spent in forums: < 1 sec
Reputation Power: 12
ok i get it now ty

 Viewing: Dev Shed Forums > Programming Languages > C Programming > Dword?