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

464 0
Honkers 2025-3-6 21:00:34 来自手机 | 显示全部楼层 |阅读模式

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
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Honkers

荣誉红客

关注
  • 4008
    主题
  • 36
    粉丝
  • 0
    关注
这家伙很懒,什么都没留下!

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2025 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行