Difference between u8, uint8_t, __u8 and __be8
uint8_t
is Standard C and represents an unsigned 8-bit integral type. If you are on a system that does not have 8-bit addressable units then this will not be defined; otherwise it is probably a typedef
for unsigned char
.
Anything with __
in it is reserved for implementation use. This means that compiler writers and standard library writers can use those identifiers without worrying about a name clash with user code. You may see this when looking in the internals of standard library implementation.
u8
is non-standard but almost certainly means the same as uint8_t
. A reason that u8
might be used is in code that was written before uint8_t
was added to Standard C.