Width
Width
Width can be omitted or be any of:
a number |
Causes printf to pad the output of this placeholder with spaces until it is at least number characters wide. As mentioned above, if number has a leading '0', that is interpreted as a flag, and the padding is done with '0' characters instead of spaces. |
* |
Causes printf to pad the output until it is n characters wide, where n is an integer value stored in the a function argument just preceding that represented by the modified type. For example printf("%*d", 5, 10) will result in "10" being printed with a width of 5. |