How is the D programming language financed?

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Dec 23 15:38:07 PST 2010


On 12/24/10, Caligo <iteronvexor at gmail.com> wrote:
> You got me excited, so I decided to give GDC another try.  I cloned the
> repo, and using GCC 4.4.5, it compiled without errors.
> I started following the examples in TDPL, but the Stat program on page 22
> gives the following errors:
>
> t1.d:33: Error: void has no value
> t1.d:33: Error: incompatible types for ((readf(" %s ",& x)) == (1)): 'void'
> and 'int'
>
> is there a typo in the code, or is this some kind of bug in GDC?

Use stdin.readf:

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

The TDPL errata is here btw, that bug is listed:
http://erdani.com/tdpl/errata/index.php?title=Main_Page


More information about the Digitalmars-d mailing list