"Tim Rentsch" <tx*@alumnus.ca ltech.edu> wrote
My point was, what C thinks of as a byte is not necessarily the
smallest addressable unit in the machine architecture. Even a machine
that had 8-bit addressable units could have a C implementation where
'bytes' were 16 bits (and that might even make sense if the local
character set were something unicode-like).
"char" is a C word, whilst "byte" is a broader concept. K and R made a
mistake by calling "chars" (a variable holding a character) and "bytes" (the
smallest adressable unit of memory) the same thing. As it happens in English
it makes sense to store characters in eight bits, which is also a common
choice for the size of a byte, but this doesn't hold for other languages and
other architectures.
The fact that an "unsigned char" holds a byte is just something we have to
live with, and the problem is further confounded when C pointers differ from
architecture addresses, whether to support multi-byte chars or to implement
8-bit chars on machines where the underlying byte size is 32 bits. So we can
talk about C bytes and hardware bytes.