Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What does% 12d mean in C language?
What does% 12d mean in C language?
Yes, output an integer with 12 bits, which is not enough for the right alignment of 12 bits.

%d is the output format controller of printf () function in C language, which means to output decimal signed integers.

% md: m is the width of the specified output field. If the number of digits of data is less than m, the left end is filled with spaces; If it is greater than m, it is output according to the actual number of digits.

Format controls always start with a format declaration, that is, with a% sign. You can insert a number between% and letters to indicate the maximum field width.

For example, %3d means to output a 3-bit integer, which is not enough for 3-bit right alignment.

Extended data:

Other formatting controls corresponding to %d:

1, %o format: output integers in unsigned octal format. Long integers can be output in "%lo" format. You can also specify the width of the field output in "%mo" format.

2.%x format: output integers in unsigned hexadecimal form. Long integers can be output in "%lx" format. You can also specify the field width and output it in "%mx" format.

3.%u format: output integers in unsigned decimal form. Long integers can be output in "%lu" format. You can also specify the field width to output in "%mu" format.

4.%c format: output a character.

Baidu Encyclopedia -printf ()