Is there an actual 8-bit integer data type in C++ -
in c++, cstdint header file, there types 8-bit integers turn out of char data type typedef. suggest actual 8-bit integer type?
yes, right. int8_t , uint8_t typedef char on platforms 1 byte 8 bits. in platforms not, appropriate definition given.
following answer based on assumption char 8 bits
char holds 1 byte, may signed or unsigned based on implementation.
so int8_t signed char , uint8_t unsigned char, safe use int8_t/uint8_t actual 8-bit integer without relying on implementation.
for implementer's point of view, typedeffing char 8 bits makes sense.
having seen this, it safe use int8_t or uint8_t real 8 bit integer.
Comments
Post a Comment