Type to use to represent a byte in ANSI (C89/90) C?

后端 未结 6 1259
一向
一向 2020-11-28 09:46

Is there a standards-complaint method to represent a byte in ANSI (C89/90) C? I know that, most often, a char happens to be a byte, but my understanding is that this is not

6条回答
  •  不知归路
    2020-11-28 10:16

    Before C99? Platform-dependent code.

    But why do you care? Just use stdint.h.

    In every implementation of C I have used (from old UNIX to embedded compilers written by hardware engineers to big-vendor compilers) char has always been 8-bit.

提交回复
热议问题