How to call readf

Petras via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 28 10:54:47 PDT 2017


On Sunday, 28 May 2017 at 15:00:30 UTC, Ali Çehreli wrote:
> On 05/28/2017 07:55 AM, Petras wrote:
> > Hi, I am learning how to use readf to read integers. I follow
> the
> > example in  https://dlang.org/library/std/stdio/readf.html
> >
> > The sample code use readf in following way
> > readf!" %d"(a);
>
> Providing the format string as a template argument and being 
> able to pass references are both 2.074 features.
>
> > It turns out that I can compile the code using ldc2 if I
> change the line to
> > readf(" %d", &a);
>
> That's the old way that should work with 2.074 as well.
>
> Ali

Thanks!


More information about the Digitalmars-d-learn mailing list