博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
处理数据时该注意的
阅读量:7234 次
发布时间:2019-06-29

本文共 715 字,大约阅读时间需要 2 分钟。

signed char 保证至少 8 位,int 保证至少 16 位,long 保证至少 32 位,long long 保证至少 64 位。

 

The only things guaranteed about integer types are:

  1. sizeof(char) == 1
  2. sizeof(char) <= sizeof(short)
  3. sizeof(short) <= sizeof(int)
  4. sizeof(int) <= sizeof(long)
  5. sizeof(long) <= sizeof(long long)
  6. sizeof(char) * CHAR_BIT >= 8
  7. sizeof(short) * CHAR_BIT >= 16
  8. sizeof(int) * CHAR_BIT >= 16
  9. sizeof(long) * CHAR_BIT >= 32
  10. sizeof(long long) * CHAR_BIT >= 64

The other things are implementation defined. Thanks to (4), both long and int can have the same size, but it must be at least 32 bits (thanks to (9)).

 

references:

http://stackoverflow.com/questions/13398630/why-are-c-int-and-long-types-both-4-bytes

转载于:https://www.cnblogs.com/foohack/p/3940846.html

你可能感兴趣的文章
MySQL优化经验和方法汇总
查看>>
JAVA获取CLASSPATH路径--转
查看>>
Linux 下测试网卡性能命令iperf 的用法
查看>>
Qt编写自定义控件大全
查看>>
.yml是什么文件
查看>>
工作总结 datatable 里的 数据 rows Columns
查看>>
006-生命周期和插件
查看>>
Geometry Imager Viewport Filter
查看>>
mysql 批量kill locked 进程
查看>>
Unix 环境高级编程
查看>>
WinForm(VB.NET)获取当前登录的用户名
查看>>
C语言 百炼成钢17
查看>>
分库分表总结
查看>>
正则表达式的优先级
查看>>
利用mvn进行多环境配置
查看>>
JMS发布/订阅消息传送例子
查看>>
Oracle 基础系列之1.2 oracle的基本使用
查看>>
POJ 1149 PIGS (最大流)
查看>>
fitnesse - 一个简单的例子(slim)
查看>>
小白也能懂的手写体识别
查看>>