系统,1个字节!= 8位? [英] System where 1 byte != 8 bit?
问题描述
所有时间我喜欢读
不靠1个字节是大小为8位
don't rely on 1 byte being 8 bit in size
使用 CHAR_BIT
而不是8作为常数比特和字节之间的转换
use CHAR_BIT
instead of 8 as a constant to convert between bits and bytes
等等。什么是真正的生活系统今天在那里,这也是如此?
<子>(我不知道是否有++对此C和C之间的差异,或者如果它实际上是语言无关的,请重新标记,如果neccessary。)
et cetera. What real life systems are there today, where this holds true? (I'm not sure if there are differences between C and C++ regarding this, or if it's actually language agnostic. Please retag if neccessary.)
推荐答案
在老机器,codeS小于8位是相当普遍的,但其中大部分都已经死了好几年了。
On older machines, codes smaller than 8 bits were fairly common, but most of those have been dead and gone for years now.
C和C ++已经授权一个的最低8位的为字符
,至少早在C89标准。
C and C++ have mandated a minimum of 8 bits for char
, at least as far back as the C89 standard. . They treat "char" and "byte" as essentially synonymous
有,但是,当前的机器(主要的DSP),其中最小的类型是大于8位 - 最低12,14,或甚至16比特是相当普遍的。 Windows CE的的确大致相同:它的最小类型(至少与微软的编译器)是16位。他们这样做的不的,但是,治疗字符
16位 - 相反,他们采取的只是不支持类型(不合格)的方法名为字符
的。
There are, however, current machines (mostly DSPs) where the smallest type is larger than 8 bits -- a minimum of 12, 14, or even 16 bits is fairly common. Windows CE does roughly the same: its smallest type (at least with Microsoft's compiler) is 16 bits. They do not, however, treat a char
as 16 bits -- instead they take the (non-conforming) approach of simply not supporting a type named char
at all.
这篇关于系统,1个字节!= 8位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!