Type
Type
Type can be any of:
d, i |
Print an int as a signed decimal number. '%d' and '%i' are synonymous for output, but are different when used with scanf() for input. |
u |
Print decimal unsigned int |
f, F |
Print a double in normal (fixed-point) notation. 'f' and 'F' only differs in how the strings for an infinite number or NaN are printed ('inf', 'infinity' and 'nan' for 'f', 'INF', 'INFINITY' and 'NAN' for 'F'). |
e, E |
Print a double value in standard form ([-]d.ddd e[+/-]ddd).An E conversion uses the letter E (rather than e) to introduce the exponent. The exponent always contains at least two digits; if the value is zero, the exponent is 00. |
g, G |
Print a double in either normal or exponential notation, whichever is more appropriate for its magnitude. 'g' uses lower-case letters, 'G' uses upper-case letters. This type differs slightly from fixed-point notation in that insignificant zeroes to the right of the decimal point are not included. Also, the decimal point is not included on whole numbers. |
x, X |
Print an unsigned int as a hexadecimal number. 'x' uses lower-case letters and 'X' uses upper-case. |
o |
Print an unsigned int in octal. |
s |
Print a character string. |
c |
Print a char (character). |
p |
Print a void * (pointer to void) in an implementation-defined format. |
n |
Print nothing, but write number of characters successfully written so far into an integer pointer parameter. |
% |
Print a literal '%' character (this type doesn't accept any flags, width, precision or length). |