TA的每日心情 | 开心 2021-12-13 21:45 |
---|
签到天数: 15 天 [LV.4]偶尔看看III
|
我想,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
|
|