Conversion Specifiers and the Resulting Printed Output

Conversion Specification

Output

%a

Floating-point number, hexadecimal digits and p-notation (C99).

%A

Floating-point number, hexadecimal digits and P-notation (C99).

%c

Single character.

%d

Signed decimal integer.

%e

Floating-point number, e-notation.

%E

Floating-point number, e-notation.

%f

Floating-point number, decimal notation.

%g

Use %f or %e, depending on the value. The %e style is used if the exponent is less than –4 or greater than or equal to the precision.

%G

Use %f or %E, depending on the value. The %E style is used if the exponent is less than –4 or greater than or equal to the precision.

%i

Signed decimal integer (same as %d).

%o

Unsigned octal integer.

%p

A pointer.

%s

Character string.

%u

Unsigned decimal integer.

%x

Unsigned hexadecimal integer, using hex digits 0f.

%X

Unsigned hexadecimal integer, using hex digits 0F.

%%

Prints a percent sign.

原文地址:https://www.cnblogs.com/flyheart33/p/3570893.html