What is the portable way to cast to-and-fro a `char`, preserving the same bit pattern?
Many methods take char
to be the ‘byte type’*. However, it is unclear (to me) whether it is implementation defined behaviour what a cast from an unsigned char
to a char
ought to do when the unsigned char
‘s value is greater than CHAR_MAX
.
(C++) What is the portable way to cast to-and-fro a `char`, preserving the same bit pattern?
Many methods take char
to be the ‘byte type’*. However, it is unclear (to me) whether it is implementation defined behaviour what a cast from an unsigned char
to a char
ought to do when the unsigned char
‘s value is greater than CHAR_MAX
.