1 and %d mean to output data according to the actual length of integer data.
2.%c is used to output a character.
3.%s is used to output strings.
4.%x means to output integers as hexadecimal numbers.
Extended data
The format of %d, %c, %s, %x and other format characters is [logo] [minimum output width] [. Accuracy] [Length] type.
For example:
"%-MD": Left-aligned. If m is less than the actual value, it is output according to the actual value.
"%m.ns": output m bits, take n bits of the string (from the left), and fill in the space on the left. When n >; When m or m is omitted, m = n.
"%m.nf": outputs floating-point numbers, where m is the width and n is the number to the right of the decimal point.
Length: h is the short plastic amount, and l is the long plastic amount.
Baidu Encyclopedia-Format Characters