Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What does% 5d mean?
What does% 5d mean?
The output mode of "%5d" means that integer values are output with a fixed bit width of 5 bits. If it is less than 5 digits, the preceding space will be filled; If it exceeds 5 digits, it will be output according to the actual digits.

%-md: the output format is plastic, the length is m (minimum output length), and it is left-aligned; M can be used to represent your 3,4,5,121;

%m.nf: the output format is float, that is, decimal with decimal point, where m is the total length and n is the decimal length.

""is an escape character and has two formats: "ddd and xhh".

Ddd:ddd stands for three-digit octal number;

Xhh: Represents a binary number 16.

Extended data

In C language, there are three representations of integers: decimal, octal and hexadecimal. Where the number starting with the number 0 and the number consisting of 0-7 are octal. It starts with 0X or 0x and consists of 0~9, A~F or a~f in 16. Except for the symbols representing positive and negative symbols, it starts with 1~9, and the decimal system consists of 0~9. 1. decimal system: except for symbols indicating positive and negative signs, it starts with 1~9 and consists of 0~9.

For example, 128, +234, -278. 2. Octal: a number consisting of 0~7 starting from 0. For example, 0126,050000.3, hexadecimal: it starts with 0X or 0x and consists of 0~9, A~F or a ~ f, for example, 0x 12A, 0x5a000.