博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c语言双精度的格式说明符_C中的格式说明符
阅读量:2507 次
发布时间:2019-05-11

本文共 1832 字,大约阅读时间需要 6 分钟。

c语言双精度的格式说明符

In this article you will get list of format specifiers in C.

在本文中,您将获得C语言格式说明符的列表。

Format specifier is used to specify the while reading or writing. For example if you want to print value of an integer type variable then you have to use %d in printf() function. Take below example.

格式说明符用于指定读取或写入时的 。 例如,如果要打印整数类型变量的值,则必须在printf()函数中使用%d。 请看下面的例子。

#include
 int main(){ int a; scanf("%d", &a); printf("%d", a); return 0;}

As you can see that I have used %d while reading and printing integer value.

如您所见,我在读取和打印整数值时使用了%d。

C language has various format specifiers that I have listed below.

C语言具有以下列出的各种格式说明符。

C格式说明符列表 (List of Format Specifiers in C)

Data Type Format Specifier
char %c
signed char %c (or %hhi for numerical output)
unsigned char %c (or %hhu for numerical output)
short
short int
signed short
signed short int
%hi
unsigned short

unsigned short int

%hu
int

signed

signed int

%i or %d
unsigned

unsigned int

%u
long

long int

signed long

signed long int

%li
unsigned long

unsigned long int

%lu
long long

long long int

signed long long

signed long long int

%lli
unsigned long long

unsigned long long int

%llu
float %f (promoted automatically to double for printf())
double %f (%F)

(%lf (%lF) for scanf())

%g  %G

%e  %E (for scientific notation)

long double %Lf  %LF

%Lg  %LG

%Le  %LE

数据类型 格式说明符
烧焦 %C
签名字符 %c(或%hhi用于数字输出)
无符号的字符 %c(或%hhu用于数字输出)
短整数
签名短
有符号的短整数
%hi
无符号短

无符号short int

%hu
整型

带符号的int

%i或%d
未签名

无符号整数

%u

长整数

长签

签名long int

%li
无符号长

无符号长整数

%鲁
长久

long long int

长签

签署long long int

%lli
无符号长久

unsigned long long int

%llu
浮动 %f(已自动提升为printf()的两倍)
%f(%F)

(scanf()的%lf(%lF))

%g%G

%e%E(用于科学计数法)

长双 %Lf%LF

%Lg%LG

%Le%LE

Comment below if you found anything incorrect or missing in above list of format specifiers in C.

如果在以上C语言格式说明符列表中发现任何不正确或缺失的内容,请在下面评论。

Source: 

资料来源: :

翻译自:

c语言双精度的格式说明符

转载地址:http://qrggb.baihongyu.com/

你可能感兴趣的文章
DRM-内容数据版权加密保护技术学习(中):License预发放实现 (转)
查看>>
TCP与UDP协议
查看>>
php上传文件如何保证上传文件不被改变或者乱码
查看>>
目录遍历代码
查看>>
iOS MD5加密实现方法
查看>>
页面中调用系统常用的对话框需要用到的classid
查看>>
cygwin下的目录软连接
查看>>
eclipse控制台不显示输出的解决办法
查看>>
Java中的TCP/UDP网络通信编程
查看>>
Trie树
查看>>
Mysql支持的数据类型(总结)
查看>>
对测试转开发的一些想法
查看>>
MVC文件上传08-使用客户端jQuery-File-Upload插件和服务端Backload组件让每个用户有专属文件夹...
查看>>
html模板中调用变量
查看>>
pacs dicom3.0 DCMTK EFilm
查看>>
大气登录页面
查看>>
应用程序缓存的应用(摘抄)
查看>>
C#析构函数,类运行结束后运行
查看>>
在LAMP的生产环境内添加PHP的cURL扩展模块
查看>>
AMH 软件目录介绍
查看>>