字节中的位数 - C 标准

Number of bits in a byte - C standard

为什么像一个字节中的位数这样基本的东西一直由 C 标准实现定义?是否有这可能有用的示例?

从 C99 开始,3.6(可在此处获得 link

3.6 byte

addressable unit of data storage large enough to hold any member of the basic character set of the execution environment

NOTE 1 It is possible to express the address of each individual byte of an object uniquely.

NOTE 2 A byte is composed of a contiguous sequence of bits, the number of which is implementation defined. The least significant bit is called the low-order bit; the most significant bit is called the high-order bit.

编辑:我问的是一些基本问题,为什么 C 标准在字节大小的位数方面提供了灵活性。没有更具体地询问 sizeof(char) CHAR_BIT != 8 有什么好处。如果问题仍然重复,请投反对票,我将关闭问题。

许多较旧的机器和 current-day DSP 具有更大的字节(例如:它们只能以 16 位的倍数寻址内存)。您肯定不想遗漏嵌入式世界的一个重要部分。