3 ms·
> Char is the byte type in C (and thus C++), both in theory Not an 8-bit byte which is the definition most people think of when talking about bytes and the onl
by account42 4y ago
> Char is the byte type in C (and thus C++), both in theory
Not an 8-bit byte which is the definition most people think of when talking about bytes and the only one that matters once you need to interact with other systems.
> and in practice.
Yes.
> Technically C++ now does indeed have a blessed byte type (std::type). But it is not an integral type: it support bitwise operations but not artihmetic ops, so signedness doesn't come into the picture.
Its signedness does matter for casts to integral types - int(std::byte(255)) == 255 whereas int(char(255)) is implemenation-defined.