Example:
a = 5;
b = 6;
printf("%*d ",a,b);
Where a stands for *, that is, %5d, and the printing format is five sheets of plastic B ..
The final output is 6. That is [4 spaces ][6].
Extended content:
Printf () function:
The printf () function is a print format function, which is generally used to output information to a standard output device in a specified format.
The calling format of printf () function is: printf (",< parameter table >).
Among them, the stylized character string includes two parts: one part is a normal character, which will be output as it is; The other part is stylized designated characters, starting with "%"followed by one or several designated characters, which are used to determine the style of the output content. The parameter table is a series of parameters required to be output, and its number must be as much as the number of output parameters described in the programmed string. Parameters are separated by ",",and the order corresponds to each other, otherwise unexpected errors will occur.
Format output, which is a function to generate print format in C language (defined in stdio.h). Used to output characters to terminals (monitors, consoles, etc.). ). Format control consists of text to be output and data format description. In addition to letters, numbers, spaces and some numerical symbols, the text to be output can also use some escape characters to express special meanings.
Reference: printf function-encyclopedia