+ 1
%*f
What is %*f in c
2 Answers
+ 3
Take a look at this: https://www.cplusplus.com/reference/cstdio/printf/
The width is not specified in the format string, but as an additional integer value argument preceding the argument that has to be formatted.
So basically for %*f it expects a size parameter (in number of characters it should take) before the actual number you need to pass:
printf("%*f", 10, num); // num with 10 characters width



