Sign in to follow this  
derek7

BYTE and WORD

Recommended Posts

I know use WORD to guarantee it is a 16bit. but typedef unsigned short WORD and the unsigned short at any compute and at any OS is guaranteed 16bit? so why use BYTE and WORD?

Share this post


Link to post
Share on other sites
To confuse matters further, word is not always 16 bit, it's a machine word, which on the x86 platform happens to be 16 bit.

For larger project, where you need size specific integrals, I've always prefered keeping a central type header with typedefs for these fixed size ints, using the annotation to clearly specify their resolution. For instance, int8, uint8, int16, and so on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this