Sign in to follow this  
SteveDeFacto

char vs BYTE array to represent raw buffer data

Recommended Posts

If you open WinDef.h, you will notice that BYTE is typedef'ed to unsigned char and thus the only difference is the signedness.

Share this post


Link to post
Share on other sites
It might help readability (though, it would be better to give the variable itself a good name). The computer won't care whether it's written 'char' or 'BYTE' in your code.

Share this post


Link to post
Share on other sites
byte makes more sense for readability. Unless your raw data is a sequence of actual characters, using the char type would be misleading.

Share this post


Link to post
Share on other sites
I'm a fan of uint8_t myself. Makes the bit width of your buffer elements explicit, which is really the most important thing to know about them.

Share this post


Link to post
Share on other sites
Quote:
Original post by coder0xff
byte makes more sense for readability. Unless your raw data is a sequence of actual characters, using the char type would be misleading.

What he said

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