本文共 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。 请看下面的例子。
#includeint 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语言具有以下列出的各种格式说明符。
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/