need info: %r in printf

lwa%mit-csr at sri-unix.UUCP lwa%mit-csr at sri-unix.UUCP
Sun Oct 16 01:48:00 AEST 1983


The %r format item is "recursive format".  It causes the next argument
in the argument list (which should be a string) to be interpreted as
a format string; the remainder of the arguments in the argument list
are printed according to the new format string.  Note that this isn't
really "recursive" in that the format strings aren't nested; when
the end of the new format string is reached the printf terminates.

Fortunately, this means it's pretty easy to simulate %r: just
concatenate (strcat) the original format string and the "recursive"
string and use the result as the format string to printf.
					-Larry Allen
-------



More information about the Comp.unix.wizards mailing list