typedef signed char int8_t;
typedef signed short int16_t;
typedef signed long int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef int32_t s32;
typedef int16_t s16; //-32768~32767
typedef int8_t s8; //-128~127
typedef uint32_t u32; //0~0xFFFF FFFF
typedef uint16_t u16; //0~65535
typedef uint8_t u8; //0~255
%5d ···········靠右对齐
%-5d ············靠左对齐
%05d ···········前边补0
%.3f ··········小数点后有三位
%4.2f ··········一共四个数(包括小数点),点后两位 点前一位
%x ·········16进制
%o ········8进制
%s ·········字符串
%c ·········字符
%% ········百分号
本文介绍了C/C++中基本数据类型的typedef声明,如int8_t、int16_t、int32_t,以及它们的无符号对应类型,并展示了格式化输出控制符的使用。重点讲解了整型和无符号整型的范围及%操作符在不同格式中的应用。
8377

被折叠的 条评论
为什么被折叠?



