what exactly is BYTE variable type?

Jan 4, 2014 at 5:11pm
^title, I saw it few times in example codes, but I have no idea what it is, or how it works, any tutorials or something?
Jan 4, 2014 at 5:28pm
A byte is a char. These days, you can typically assume a byte contains eight bits of data. (If you are using C or C++, it must.)

When Microsoft was designing Windows, they did something forward thinking (at the time) and created some #defines (instead of typedefs, IDK why) to control the basic types used in their header files.

This makes it possible to update the underlying system DLLs, and programs that compiled against them only needed to update their headers.

A BYTE is an octet, or an eight-bit integer (either signed or unsigned).
A WORD is a sixteen-bit integer.
A DWORD is a double-word, or 32-bit integer.

Unless you are playing with the Windows API, you shouldn't have any need to use the BYTE macro/typedef.

Hope this helps.
Jan 4, 2014 at 6:29pm
BYTE is a typedef for unsigned char used by Windows SDK.
Jan 5, 2014 at 11:06am
So there is no use of byte in any game development??? am i right O.o
Topic archived. No new replies allowed.