Type DWORD in C/C++ what is it???
Solved
little_titi
Posted messages
250
Status
Member
-
crazydieter -
crazydieter -
Hello,
I would like to know what a DWORD variable in C/C++ corresponds to? What is it used for?
Thank you!
--
The speed of light is faster than the speed of sound, which is why some people appear bright before they look stupid!
I would like to know what a DWORD variable in C/C++ corresponds to? What is it used for?
Thank you!
--
The speed of light is faster than the speed of sound, which is why some people appear bright before they look stupid!
Configuration: Windows XP Firefox 2.0.0.17
3 answers
-
DWORD, it must be double word, it corresponds to a variable of a certain number of bytes or bits.
I believe the word is 4 bytes, the double word should be 8.
It is used to know the size of the variable regardless of the C implementation.
--
Greetings! I used to think, now I am sure.Jesus Christ
Char Sniper-
Hey, hello again Char sniper! How are you? ;)
I saw that DWORD is similar to longWord, which is a 32-bit unsigned word. I also think that the D stands for double, as you mentioned. Apparently, these types are used in the context of Windows applications, or at least that's what I understood.
Thanks for the info! See you soon!
--
The speed of light being faster than the speed of sound explains why some people appear so bright before they look dumb!
-
-
Hello
When a word like DWORD is not part of the standard C, it is defined in some .h file. Just right-click on DWORD and choose "GOTO definition of DWORD".
VC++ will take you to windef.h at the line:
typedef unsigned long DWORD; -
Just for the record... Octet: 1 byte. Are we good so far?
Word: 2 bytes.
DWord: 4 bytes.
D: Double
No relation to Windows applications.
And for the rest, there's Google. No need to code if you can't figure that out, nor to succeed in searching for it otherwise.-
-
Truth,
I do not agree with you. Moreover, if you read carefully, John did not say that DWORD is 2 bytes, but he said 4.
I will add my comment:
DWORD is not native in C; it is a type defined in the header windows.h. It can be an unsigned long, but not necessarily; it could be, why not, an unsigned long long (in C99). Furthermore, we do not talk about bytes for a type but rather byte (knowing that in C, bytes are at least 8 bits).
The size of DWORD, therefore, depends on several criteria. -
-
@Truth
1 bit [fr/eng] != 1 octet [fr] == 1 byte [eng] == 8 bits
And this, no matter the machine. It's just a matter of terminology, but it's still important if we want to communicate effectively.
It's the classic situation. After a while, we don't even know what we're talking about anymore...
@Hugooguh
I agree. -
-