Formatted read consumes input

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Aug 24 09:37:57 PDT 2012


On 24-Aug-12 17:43, Tove wrote:
> On Friday, 24 August 2012 at 11:18:55 UTC, Dmitry Olshansky wrote:
>> C's scanf is a poor argument as it uses pointers instead of ref (and
>> it can't do ref as there is no ref in C :) ). Yet it doesn't allow to
>> read things in a couple of calls AFAIK. In C scanf returns number of
>> arguments successfully read not bytes so there is no way to continue
>> from where it stopped.
>>
>> BTW it's not documented what formattedRead returns ... just ouch.
>
> Actually... look up "%n" in sscanf it's wonderful, I use it all the time.
>
God... what an awful kludge :)

-- 
Olshansky Dmitry


More information about the Digitalmars-d mailing list