Why do C compilers specify long to be 32-bit and long long to be 64-bit?

后端 未结 6 1804
醉酒成梦
醉酒成梦 2021-01-04 12:53

Wouldn\'t it have made more sense to make long 64-bit and reserve long long until 128-bit numbers become a reality?

6条回答
  •  误落风尘
    2021-01-04 13:20

    The c standard have NOT specified the bit-length of primitive data type, but only the least bit-length of them. So compilers can have options on the bit-length of primitive data types. On deciding the bit-length of each primitive data type, the compiler designer should consider the several factors, including the computer architecture.

    here is some references: http://en.wikipedia.org/wiki/C_syntax#Primitive_data_types

提交回复
热议问题