Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #160389
| Path | csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.lang.c |
| Subject | Re: simple positional printf code review |
| Date | Tue, 27 Apr 2021 01:46:38 +0100 |
| Organization | A noiseless patient Spider |
| Lines | 30 |
| Message-ID | <87h7jsftap.fsf@bsb.me.uk> (permalink) |
| References | <6e8017a1-ca34-4e99-b541-b2ba87b9cc66n@googlegroups.com> <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> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | reader02.eternal-september.org; posting-host="2bf7705d1b97f6a205dcbeaeb8836bff"; logging-data="29167"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7xRavrQyUYHb8SvTyVbTm4sK9N6UEgdc=" |
| Cancel-Lock | sha1:Zrcom/4AnH+SQyY4oVbuyN0YDkM= sha1:g2c18NIWt6buH7cF1my1FEv0iJU= |
| X-BSB-Auth | 1.d0d9329bbd4e7e58921b.20210427014638BST.87h7jsftap.fsf@bsb.me.uk |
| Xref | csiph.com comp.lang.c:160389 |
Show key headers only | 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
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