All pastes #489013 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-15 09:22 UTC
rendered paste body
       The arguments must correspond properly (after type promotion) with the conversion specifier. By default, the arguments
       are used in the order given, where each `*' and each conversion specifier asks for the next argument  (and  it  is  an
       error  if  insufficiently many arguments are given).  One can also specify explicitly which argument is taken, at each
       place where an argument is required, by writing `%m$' instead of `%' and `*m$' instead of `*', where the decimal inte-
       ger m denotes the position in the argument list of the desired argument, indexed starting from 1. Thus,
                   printf("%*d", width, num);
       and
                   printf("%2$*1$d", width, num);
       are  equivalent.  The  second style allows repeated references to the same argument. The C99 standard does not include
       the style using `$', which comes from the Single Unix Specification.  If the style using `$' is used, it must be  used
       throughout for all conversions taking an argument and all width and precision arguments, but it may be mixed with `%%'
       formats which do not consume an argument.  There may be no gaps in the numbers of arguments specified using  `$';  for
       example, if arguments 1 and 3 are specified, argument 2 must also be specified somewhere in the format string.