Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #160389

Re: simple positional printf code review

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: simple positional printf code review
Date 2021-04-27 01:46 +0100
Organization A noiseless patient Spider
Message-ID <87h7jsftap.fsf@bsb.me.uk> (permalink)
References (1 earlier) <s678d7$8uf$1@dont-email.me> <s6790c$8uf$2@dont-email.me> <f024614a-ed9b-48d9-86e1-041a649f185fn@googlegroups.com> <871rawhhxu.fsf@bsb.me.uk> <dedb025c-1fd8-4816-860a-c02c8e23a87en@googlegroups.com>

Show all headers | View raw


Thiago Adams <thiago.adams@gmail.com> writes:

> On Monday, April 26, 2021 at 6:09:12 PM UTC-3, Ben Bacarisse wrote:
>> Thiago Adams <thiago...@gmail.com> writes: 
>> 
>> > On Monday, April 26, 2021 at 5:49:23 PM UTC-3, Lew Pitcher wrote: 
>> >> damn keyboard, switched the questionmark and dollarsign on me :-S 
>> > [..] 
>> >> > printf("%2$*1$d", width, num); 
>> > 
>> > This worked at Windows..but snprintf apparently is not implemented on 
>> > windows.
>> That may be due to MS pushing the snprintf_s version. Have you tried 
>> that? (I can't -- no access to an MS C ompiler.) 
>
> In linux the same printf works for positional arguments...
> in windows we need to use another function called  printf_p 
> in windows normal printf("%2$*1$d", width, num);  does not work.

Sorry, we've got a bit lost.  I was only commenting on "snprintf
apparently is not implemented on windows".  I was not referring to
whether any of these functions implemented positional parameters.  I
seem to remember someone saying that a lot of C functions are now hidden
by default because MS want you to use the _s versions.

Sorry if this side point was not clear.  And double sorry if I am wrong
about it altogether -- it is second hand information.

-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

simple positional printf code review Thiago Adams <thiago.adams@gmail.com> - 2021-04-26 13:29 -0700
  Re: simple positional printf code review Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2021-04-26 20:39 +0000
    Re: simple positional printf code review Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2021-04-26 20:49 +0000
      Re: simple positional printf code review Thiago Adams <thiago.adams@gmail.com> - 2021-04-26 14:00 -0700
        Re: simple positional printf code review Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-26 22:09 +0100
          Re: simple positional printf code review Thiago Adams <thiago.adams@gmail.com> - 2021-04-26 14:18 -0700
            Re: simple positional printf code review Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-27 01:46 +0100
              Re: simple positional printf code review "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-04-26 18:19 -0700
                Re: simple positional printf code review Thiago Adams <thiago.adams@gmail.com> - 2021-04-27 04:44 -0700
        Re: simple positional printf code review Geoff <geoff@invalid.invalid> - 2021-04-26 17:58 -0700
          Re: simple positional printf code review Kaz Kylheku <563-365-8930@kylheku.com> - 2021-04-27 15:58 +0000
    Re: simple positional printf code review Thiago Adams <thiago.adams@gmail.com> - 2021-04-26 13:53 -0700
  Re: simple positional printf code review Kaz Kylheku <563-365-8930@kylheku.com> - 2021-04-26 21:53 +0000

csiph-web