当前位置:网站首页>Anatomy of Storage Size, Value Range, and Output Format of Basic Data Types in C Language
Anatomy of Storage Size, Value Range, and Output Format of Basic Data Types in C Language
2022-08-09 17:47:00 【I'm free*】
Table of Contents
One.Integer
type | Storage size | value range | Output format |
int | 4 bytes (32 bits) | (-2,147,483,648——2,147,483,648) (-2^31——2^31) | %d |
short | 2 bytes (16 bits) | (-32,768——32,768) (-2^15——2^15) | %d |
long | 4 bytes (32 bits) | (-2,147,483,648——2,147,483,648) (-2^31——2^31) | %ld |
long long | 8 bytes (64-bit) | (-9,223,372,036,854,775,808—— 9,223,372,036,854,775,808) (-2^63-2^63) | %lld |
unsigned int | 4 bytes (32 bits) | (0——4,294,967,296) | %u |
2.Real
Type | Storage size | value range | Output format | Accuracy |
float | 4 bytes (32 bits) | -3.4E+38——3.4E+38 | %f | 6-7 |
double | 8 bytes (64-bit) | -1.7E+308——1.7E+308 | %lf | 15-16 |
Three.Character
type | Storage size | value range | Output format |
char | 1 byte (8 bits) | -128——127 | %c |
unsigned char | 1 byte (8 bits) | 0-255 | %c %hhu |
Note:%hhu converts characters to ASCII values
边栏推荐
猜你喜欢
随机推荐
选择器的使用
单臂路由与三层交换机实现跨VLAN通讯
域控同步相关命令
选择排序法(C语言)
MYSQL数据库一周基础入门(第二天)
Win10 Runas 命令 域用户以管理员权限运行
qemu虚拟机模拟固件环境搭建
Heap series_0x06: NT global flags and gflags.exe one page
js和jq实现点击小眼睛后密码显示与隐藏切换
NAT种类及配置
properties文件的读取和写入
Office365 AzureAD Intune 配置
布隆过滤器及LRU Cache的实现
华为防火墙相关命令
2022华数杯建模C题思路解析
Xshell显示乱码
List,Set,Map,Queue,Deque,Stack遍历方式总结
2022华数杯C题:插层熔喷非织造材料的性能控制研究 - 思路
Codeforces Round #808 (Div. 2)||沉淀
如何用栈实现队列