C语言中格式说明符及其对应的完整英文名称

在C语言中,格式化输出字符串中的格式说明符用于指定如何解释和显示数据。以下是一些常见的格式说明符及其对应的完整英文名称:

%d 或 %i:decimal integer(十进制整数)
%u:unsigned decimal integer(无符号十进制整数)
%o:octal integer(八进制整数)
%x:hexadecimal integer (lowercase letters)(十六进制整数,小写字母)
%X:hexadecimal integer (uppercase letters)(十六进制整数,大写字母)
%f:floating point number (decimal notation)(浮点数,十进制表示)
%e:floating point number (scientific notation, lowercase 'e')(浮点数,科学计数法,小写'e'%E:floating point number (scientific notation, uppercase 'E')(浮点数,科学计数法,大写'E'%g:uses %e or %f, whichever is shorter(使用%e或%f,取较短的那个)
%G:uses %E or %f, whichever is shorter(使用%E或%f,取较短的那个)
%c:character(字符)
%s:string of characters(字符串)
%p:pointer address(指针地址)
%n:nothing 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.(不打印任何内容。对应的参数必须是一个指向有符号整数的指针。到目前为止写入的字符数存储在指向的位置。)

其中常用的部分为:

%d%i:decimal integer(十进制整数
%f:floating point number (decimal notation)(浮点数,十进制表示
%c:character(字符
%s:string of characters(字符串
%p:pointer address(指针地址

这些格式说明符用于printf、scanf和其他类似的函数中,以指定如何格式化和解析输入输出数据。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值