Skip to main content
GameDev.net gamedev.net
🔒 Locked

Microsoft WORD sizes

Started by incertia Apr 11, 2013 at 12:52 AM 0 replies 1.5k views
Original Post
incertia
incertia
I've heard that Microsoft WORD will always be 16-bit and DWORD will always be 32-bit. Is this because they change the types (say from unsigned long to unsigned short) whenever the system WORD size changes?
what
L. Spiro
L. Spiro

Microsoft® Visual Studio® uses the LLP64/IL32P64 data model which ensures that shorts are always 16 bits, ints and longs are always 32 bits, long long/long int are always 64 bits, etc.

In this case that means there is no need to change the typedef between compiler settings, but if the sizes were to change the WORD and DWORD typedefs would change to ensure their sizes remain 16- and 32- bits respectively.

If you are worried about sizes on Microsoft® Visual Studio® you can always use the __int16 and __int32 family of primitives.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.