It's nothing but the formatted output and some characters.
%
--> means the character after %
is the place holder and will be replaced by the respective argument.
But here few things came into picture that's why you are confused.
.
--> Exactly *
means sizeof(r)-1
space occupied
*
--> which will specify the size or width of characters to be printed and *
will be replaced by sizeof(r)-1
.
-
--> is for left adjustment or alignment.
last s
--> will be replaced by s
which is string.
Also sprintf()
means printing to the buffer. In this case it's r
.
EDIT : In case of .
, See this general scenario of printing.
printf("%sx.yz",args);
// just forget about the `args` it can be as many as the format specifiers,
// it's an example for one argument.
s = sign, can be `+` or `-`.`+` means right adjustment `-`means left adjustment.
x = At least `x` characters wide.
y = Exactly `y` charactes wide.
z = format specifier like `s`,`d`,`f` and so on as for corresponding arguments. `