Subject: Re: printf problem: "%1$s" not handled?
From: [email-masked] (Fergus Henderson)

21 Apr 1998 07:07:58 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: "Richard H. Gumpertz" <[email-masked]>
Cc: Christopher Lee <[email-masked]>, [email-masked]

On 19-Apr-1998, Richard H. Gumpertz <[email-masked]> wrote:
> Christopher Lee <[email-masked]>:
> > 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 <[email-masked]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [email-masked]        |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".