uint8_t/uint16_t/uint32_t/uint64_t 等是什么数据类型
2015-09-13 16:51
531 查看
我想,uint8、uint16、uint32、uint64 这大家可能比较理解unit,unsigned int 嘛
uint8,我想很多人也能够理解,其实是unsigned char
那么 _t 呢?其实就是 typedef 的意思
我们在学习标准的C语言时,常见的有 bit、char、short、int、long、float、double等
却几乎不曾见到uint8、uint16 等
所以,人家在这些自定义数据类型后面加 _t 来表示这些数据类型是 typedef 的
以上数据类型在C99中定义如下,其他地方的引用也大同小异了。
这些数据类型是 C99 中定义的,具体定义在:/usr/include/stdint.h ISO C99: 7.18 Integer types
#ifndef __int8_t_defined
# define __int8_t_defined
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
# if __WORDSIZE == 64
typedef long int int64_t;
# else
__extension__
typedef long long int int64_t;
# endif
#endif
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
# define __uint32_t_defined
#endif
#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
__extension__
typedef unsigned long long int uint64_t;
#endif
uint8,我想很多人也能够理解,其实是unsigned char
那么 _t 呢?其实就是 typedef 的意思
我们在学习标准的C语言时,常见的有 bit、char、short、int、long、float、double等
却几乎不曾见到uint8、uint16 等
所以,人家在这些自定义数据类型后面加 _t 来表示这些数据类型是 typedef 的
以上数据类型在C99中定义如下,其他地方的引用也大同小异了。
这些数据类型是 C99 中定义的,具体定义在:/usr/include/stdint.h ISO C99: 7.18 Integer types
#ifndef __int8_t_defined
# define __int8_t_defined
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
# if __WORDSIZE == 64
typedef long int int64_t;
# else
__extension__
typedef long long int int64_t;
# endif
#endif
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
# define __uint32_t_defined
#endif
#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
__extension__
typedef unsigned long long int uint64_t;
#endif
相关文章推荐
- hibernate主键生成策略 @GeneratedValue 与 @GenericGenerator
- IOS UI学习 UITableView Demo 实现类似QQ联系人收起和展开效果
- UIScreen 类
- 给UITextView添加PlaceHolder
- UI课程06 UIController及其子类,已学所有类的关系
- 百度UEditor基本使用
- UI课程05 设计模式,手势识别
- Make Project Sponsors Write Their Own Requirements
- Gradle User Guide(3)——使用命令行
- iOS8中UIBarButtonItem的setTitleTextAttributes对Disabled颜色设置无效
- Error:No suitable device found: no device found for connection "System eth0"
- The Building Blocks-Components of EA part 1- Information and Strategy
- android-saripaar:Android UI输入验证框架
- hdu 4915 Parenthese sequence--2014 Multi-University Training Contest 5
- UIDevice 类
- IOS UI学习 UITableView ----- UITableViewDelegate
- 滚动视图UIScrollView、UIPageControl
- iOS开发:UITouch控件与触摸事件
- 基本类 UIKit框架
- Gradle User Guide(2)