+ 1

%*f

What is %*f in c

5th Apr 2021, 12:43 PM
Surya L
Surya L - avatar
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
5th Apr 2021, 1:38 PM
PerkZz🔨
PerkZz🔨 - avatar