数据类型 | 输出方式 |
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(H) | %0x |
unsigned long/long(H) | %0lx |
long long/unsigned long long(H) | %0llx |
unsigned int/int(O) | %0o |
unsigned long/long(O) | %0lo |
long long/unsigned long long(O) | %0llo |
float | %f |
double | %lf |
科学技术类型(必须转化为double类型) | %e |
限制输出字段宽度 | %x.yf(x:整数长度;y:小数点长度) |
C语言——printf中各种数据类型的打印方式
于 2023-09-12 16:07:10 首次发布