码迷,mamicode.com
首页 > 其他好文 > 详细

与平台无关的类型,int8_t,uint8_t

时间:2016-07-13 20:34:50      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:

pecific integral type limits
SpecifierCommon EquivalentSigningBitsBytesMinimum ValueMaximum Value
int8_t signed char Signed 8 1 −128 127
uint8_t unsigned char Unsigned 8 1 0 255
int16_t short Signed 16 2 −32,768 32,767
uint16_t unsigned short Unsigned 16 2 0 65,535
int32_t int Signed 32 4 −2,147,483,648 2,147,483,647
uint32_t unsigned int Unsigned 32 4 0 4,294,967,295
int64_t long long Signed 64 8 −9,223,372,036,854,775,808 9,223,372,036,854,775,807
uint64_t unsigned long long Unsigned 64 8 0 18,446,744,073,709,551,615

上面是一些与平台无关的数据类型,由于在32位机器和64位机器中,long占据不同的字节数,所以推荐使用上面的类型。。上面的类型的头文件是stdint.h

与平台无关的类型,int8_t,uint8_t

标签:

原文地址:http://www.cnblogs.com/DswCnblog/p/5667032.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!