What is a “byte” in C / C++

前端 未结 2 1350
温柔的废话
温柔的废话 2021-01-07 22:21

For example, here\'s a reference for fread:

size_t fread ( void * ptr, size_t size, size_t count, FILE * stream );

Reads an array of count

相关标签:
2条回答
  • 2021-01-07 22:47

    C99, §3.6:

    byte

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

    and §5.2.4.2.1:

    CHAR_BIT — number of bits for smallest object that is not a bit-field (byte)

    Thus, a "byte" contains CHAR_BIT bits.

    0 讨论(0)
  • 2021-01-07 22:51

    CHAR_BIT. The bit width of a byte is implementation-defined and is available to the developer via the CHAR_BIT macro.

    0 讨论(0)
提交回复
热议问题