编程常用资料/网站收集

本文详细介绍了C语言中取整函数`floor`、`ceil`和`round`的用法,以及`printf`格式化输出的详细说明,包括各种格式符的含义和适用类型。同时,探讨了C语言在32位CPU环境下各类型的数据范围,并对比了32位和64位变量的空间差异。此外,还列举了一些编程工具类网站和资源。
摘要由CSDN通过智能技术生成

资料收集

ascii码表

在这里插入图片描述

c语言取整与四舍五入

floor函数
向下取整。floor(x)返回的是x的整数部分。如: floor(2.5) = 2 floor(-2.5) = -3

ceil函数
向上取整。ceil(x)返回的是不大于x的最小整数。如: ceil(2.5) = 3 ceil(-2.5) = -2 floor和ceil对于正数没有区别,但是对于负数结果不同。floor()是向负无穷大舍入,floor(-2.5) = -3;ceil()是向正无穷大舍入,ceil(-2.5) = -2。

round(x) 返回x的四舍五入整数值。

printf格式符

lengthd iu o x Xf F e E g G a Acspn
(none)intunsigned intdoubleintchar*void*int*
hhsigned charunsigned charsigned char*
hshort intunsigned short intshort int*
llong intunsigned long intwint_twchar_t*long int*
lllong long intunsigned long long intlong long int*
jintmax_tuintmax_tintmax_t*
zsize_tsize_tsize_t*
tptrdiff_tptrdiff_tptrdiff_t*
Llong double
注:此表格说明了各种控制符及其长度符号的各种组合及适用对象,比如%ld用于long int符号,而

printf格式符释义

specifierOutputExample
d or iSigned decimal integer392
uUnsigned decimal integer7235
oUnsigned octal610
xUnsigned hexadecimal integer7fa
XUnsigned hexadecimal integer (uppercase)7FA
fDecimal floating point, lowercase392.65
FDecimal floating point, uppercase392.65
eScientific notation (mantissa/exponent), lowercase3.9265e+2
EScientific notation (mantissa/exponent), uppercase3.9265E+2
gUse the shortest representation: %e or %f392.65
GUse the shortest representation: %E or %F392.65
aHexadecimal floating point, lowercase-0xc.90fep-2
AHexadecimal floating point, uppercase-0XC.90FEP-2
cCharactera
sString of characterssample
pPointer addressb8000000
nNothing printed. The corresponding argument must be a pointer to a signed int.The number of characters written so far is stored in the pointed location.
% A% followed by another % character will write a single % to the stream.%

c语言各类型取值范围(32位cpu)

类型范围
char-128~+127
unsigned char0~255
short-32768~32768
unsigned short0~65535
int-2147483648~2147483647
unsigned int0~4294967295
long-2147483648~2147483647
unsigned long0~4294967295
long long的最小值:-9223372036854775808
long long的最大值:9223372036854775807
unsigned long long0~18446744073709551615
float-2^128 ~ +2^128 精度为6~7位有效数字
double-2^1024 ~ +2^1024 精度为15~16位有效数字

32/64位变量空间对比

类型32位字节数64位字节数
bool11
char11
unsigned char11
short22
unsigned short22
int44
unsigned int44
long48
unsigned long48
Type *ptr48

工具类网站收集

综合

菜鸟教程

编程语言

解释c语言复杂定义

linux

可视化vim配置文件生成
在线man手册
在线linux源码
内核镜像源
逐步从源码构建linux-lfs
linux内核手册
linux内核wiki
gnu官方在线手册
linux内核代码地图
所有gnu软件列表

前端

html参考手册
css参考手册
travis-ci yaml格式持续集成构建
codecov 集成测试覆盖率工具
simpleicons 图标素材
字节跳动图标库
阿里巴巴图标库
vercel 静态托管平台

网络协议

网络协议报文格式
协议报文字段含义查询
华为 IP知识百科
H3C ICT知识百科

工具类

在线文本比较工具

杂项

编程语言排行
网站排名
ping及其他网络工具
正则练习
双拼练习
在线文本差异对比

数据结构

visualgo
usfca

有趣的网站收集

花光比尔盖茨的钱
假装自己是黑客
360度全景图
网络搜索引擎
测试你的反应能力
I Wanna Be the Guy游戏

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值