From: fjh AT cs DOT mu DOT OZ DOT AU (Fergus Henderson) Subject: Re: printf problem: "%1$s" not handled? 21 Apr 1998 07:07:58 -0700 Message-ID: <19980421015919.24453.cygnus.gnu-win32@murlibobo.cs.mu.OZ.AU> References: <001b01bd6a64$d918d8c0$15d0d3c6 AT chris-lee DOT mag DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: "Richard H. Gumpertz" Cc: Christopher Lee , gnu-win32 AT cygnus DOT com On 19-Apr-1998, Richard H. Gumpertz wrote: > Christopher Lee : > > I'm having trouble on gnu-win32-b19.1 with the printf/sprintf functions. > > Basically, positional parameters don't seem to be working: .... > > printf("<%1$s> <%2$s> <%3$s> <%4$s>\n","one","two","three","four"); .... > > Any way to fix this? e.g. to replace printf/sprintf in B19.1 with ANSI > > versions? > > What is the '$' in your control strings? I've never seen that in printf > control strings. Is that the source of your problem? Is it some sort of > local extension? `$' for positional paramters in printf() format strings is not part of the ANSI C standard, and if I recall correctly, it is not supported by POSIX either. It is however part of the X/Open standard, I think. -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3 | -- the last words of T. S. Garp. - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".