TDPL's use of readf

Jeff Merrick merrick.jd at gmail.com
Wed Jun 23 20:59:13 PDT 2010


On page 22 of TDPL, we have the following code:

import std.contracts, std.stdio;
void main(string[] args) {
  // ...
  for (double x; readf(" %s ", &x) == 1; ) {
    // ...
  }
  // ...
}

Using DMD v2.047, I get the following error on the readf call:

  Error: undefined identifier readf, did you mean function readln?

I didn't see this mentioned in the TDPL errata.  Was there a change to the standard library after the book
went to press?  Or am I doing something wrong?

Thanks,

Jeff


More information about the Digitalmars-d-learn mailing list