size guarantee for integral/arithmetic types in C and C++

前端 未结 7 2139
难免孤独
难免孤独 2020-12-15 00:49

I know that the C++ standard explicitly guarantees the size of only char, signed char and unsigned char. Also it gives guarantees that

7条回答
  •  离开以前
    2020-12-15 00:58

    Be aware that the guaranteed ranges of these types are one less wide than on most machines:

    signed char -127 ... +127 guranteed but most twos complement machines have -128 ... + 127

    Likewise for the larger types.

提交回复
热议问题