What platforms have something other than 8-bit char?

前端 未结 12 1263
再見小時候
再見小時候 2020-11-22 00:31

Every now and then, someone on SO points out that char (aka \'byte\') isn\'t necessarily 8 bits.

It seems that 8-bit char is almost universal. I would h

12条回答
  •  长发绾君心
    2020-11-22 01:18

    The C and C++ programming languages, for example, define byte as "addressable unit of data large enough to hold any member of the basic character set of the execution environment" (clause 3.6 of the C standard). Since the C char integral data type must contain at least 8 bits (clause 5.2.4.2.1), a byte in C is at least capable of holding 256 different values. Various implementations of C and C++ define a byte as 8, 9, 16, 32, or 36 bits

    Quoted from http://en.wikipedia.org/wiki/Byte#History

    Not sure about other languages though.

    http://en.wikipedia.org/wiki/IBM_7030_Stretch#Data_Formats

    Defines a byte on that machine to be variable length

提交回复
热议问题