I just stumbled upon the type u_int8_t
because it did not compile in Windows+MinGW (but compiled fine under Linux). According to this site the C++11 standard defines the type uint8_t
. I just used the latter and everything worked.
The questions that arised are:
- Is there any difference between
u_int8_t
anduint8_t
? - Is there a reason (besides legacy code) to use
u_int8_t
? - Is it safe to assume that
uint8_t
will be present if I use a C++11 compiler (on different OS or architectures)? - Are the answers to the above questions also valid for the other types (
intX_t
anduintX_t
)?
cstdint
andstdint.h
. The typeu_int8_t
is defined insys/types.h
. But this header is usually not available in Windows and/or MinGW. – Idun