Dave Caroline wrote:
I normally create a byte type to be sure of an 8 bit
byte.
If you're using standard C, the portable way to have an 8-bit type is to
include <stdint.h> or <inttypes.h>, and use int8_t (for signed) or
uint8_t (for unsigned). These are the only types that are guaranteed to
be exactly 8 bits.
Of course, if you're using a C implementation that isn't compliant with
the standard, such as a Microsoft compiler, you have to choose something
that isn't. With Microsoft compilers, I usually throw together my own
subset of stdint.