More detailed [here](
[To see links please register here]
).
> integer value or `*` that specifies minimum field width. The result is padded with space characters (by default), if required, on the left when right-justified, or on the right if left-justified. In the case when * is used, the width is specified by an additional argument of type int. If the value of the argument is negative, it results with the - flag specified and positive field width. (Note: This is the minimum width: The value is never truncated.)
> `.` followed by integer number or *, or neither that specifies precision
> of the conversion. In the case when * is used, the precision is
> specified by an additional argument of type int. If the value of this
> argument is negative, it is ignored. If neither a number nor * is
> used, the precision is taken as zero. See the table below for exact
> effects of precision.
So if we try both conversion specification
#include <stdio.h>
int main() {
int precision = 8;
int biggerPrecision = 16;
const char *greetings = "Hello world";
printf("|%.8s|\n", greetings);
printf("|%.*s|\n", precision , greetings);
printf("|%16s|\n", greetings);
printf("|%*s|\n", biggerPrecision , greetings);
return 0;
}
we get the output:
|Hello wo|
|Hello wo|
| Hello world|
| Hello world|