数据类型 打印格式
u8 (unsigned char) %d
s8 (signed char) %d
u16 (unsigned short) %d or %hu
s16 (signed short) %d or %hd
u32 (unsigned int) %u
s32 (signed int) %d
u64 (unsigned long long) %llu
s64 (signed long long) %lld
int %d
unsigned int %u
short int %d or %hd
long %ld
unsigned long %lu
long long %lld
unsigned long long %llu
char %c
char * %s
bool (#define stdbool.h) %d
unsigned int / int > 十六进制 %0x
unsigned long / long> 十六进制 %0lx
long long / unsigned long long ==> 十六进制 %0llx
unsigned int / int ==> 八进制 %0o
unsigned long / long == > 八进制 %0lo
long long / unsigned long long ==> 八进制 %0llo
float %f
double %f or %lf
科学技术类型(必须转化为double类型) %e
限制输出字段宽度 %x.yf (x:整数长度,y:小数点长度)
软件编程常用数据类型打印print
最新推荐文章于 2023-08-22 16:16:50 发布