0
点赞
收藏
分享

微信扫一扫

【C/C++基础】C语言数据类型表

elvinyang 2022-04-01 阅读 90
c语言c++

C语言数据类型表

关键字位长(字节)范围格式化字符串
char1 bytes-128…127(或0…255,与体系结构相关)%c
unsigned char1bytes0…255%c, %hhu
signed char1bytes-128…127%c, %hhd, %hhi
int2bytes(16位系统) 或 4bytes-32768…32767 或 -2147483648…2147483647%i, %d
unsigned int2bytes 或 4 bytes0…65535 或 0…4294967295%u
signed int2bytes 或 4bytes-32768…32767 或 -2147483648…2147483647%i, %d
short int2bytes-32768…32767%hi, %hd
unsigned short2 bytes0…65535%hu
signed short2bytes-32768…32767%hi, %hd
long int4bytes 或 8bytes[6]-2147483648…2147483647 或 -9223372036854775808…9223372036854775807%li, %ld
unsigned long4bytes 或 8 bytes0…4294967295 或 0…18446744073709551615%lu
signed long4 bytes或 8bytes-2147483648…2147483647 或 -9223372036854775808…9223372036854775807%li, %ld
long long8bytes-9223372036854775808…9223372036854775807%lli, %lld
unsigned long long8bytes0…18446744073709551615%llu
float4bytes2.939x10−38…3.403x10+38 (7 sf)%f, %e, %g
double8bytes5.563x10−309…1.798x10+308 (15 sf)%lf, %e, %g
long double10bytes或 16bytes7.065x10-9865…1.415x109864 (18 sf或33 sf)%lf, %le, %lg
举报

相关推荐

0 条评论