6,198
社区成员
发帖
与我相关
我的任务
分享uint8_t 是一个数据类型,也是别名,它是无符号8位整数类型的缩写。
uint 表示无符号整数,即数值不能为负数; 8 表示该类型的大小为8位,即该类型可表示的最大值255,最小值0; _t 表示别名,用typedef定义的数据类型。
在C++和C语言中,uint8_t 通常是通过标准头文件 stdint.h 或 cinttypes 导入的。
在C99标准中定义了这些数据类型,具体定义在stdint.h中。
/* exact-width signed integer types */
typedef signed char int8_t;
typedef signed short int int16_t;
typedef signed int int32_t;
typedef signed __INT64 int64_t;
/* exact-width unsigned integer types */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __INT64 uint64_t;
负数和非负数的概念,从而提高代码的可读性和可维护性;
文章来源: https://blog.csdn.net/weixin_42465316/article/details/130503533
版权声明: 本文为博主原创文章,遵循CC 4.0 BY-SA 知识共享协议,转载请附上原文出处链接和本声明。