C语言各种数据类型的占位符

char – %c或%hhd %c采用字符身份,%hhd采用数字身份;
unsigned char – %c或%hhu
short – %hd
unsigned short – %hu
long – %ld
unsigned long – %lu
int – %d
unsigned int – %u
float – %f或%g %f会保留小数点后面无效的0,%g则不会;
double – %lf或%lg

你可能感兴趣的:(C++,C)