Type DWORD in C/C++ what is it???
Solved
little_titi
Posted messages
250
Status
Membre
-
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 réponses
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
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
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.
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.
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.
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.
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!