gpt4 book ai didi

c - C 中的类型有任何保证的最小尺寸吗?

转载 作者:太空狗 更新时间:2023-10-29 16:39:12 25 4
gpt4 key购买 nike

您通常可以对数据类型的最小大小做出任何假设吗?

目前我读到的内容:

  • 字符:1个字节
  • 短:2 字节
  • int:2 字节,通常为 4 字节
  • 长:4字节

漂浮???双???

float.hlimits.h 中的值是否依赖于系统?

最佳答案

这包含在 Wikipedia article 中:

A short int must not be larger than an int.
An int must not be larger than a long int.

A short int must be at least 16 bits long.
An int must be at least 16 bits long.
A long int must be at least 32 bits long.
A long long int must be at least 64 bits long.

The standard does not require that any of these sizes be necessarily different. It is perfectly valid, for example, if all four types are 64 bits long.

关于c - C 中的类型有任何保证的最小尺寸吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1738568/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com