How is the D programming language financed?

Caligo iteronvexor at gmail.com
Thu Dec 23 15:50:44 PST 2010


On Thu, Dec 23, 2010 at 5:38 PM, Andrej Mitrovic <andrej.mitrovich at gmail.com
> wrote:

> 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
>


great, that fixed the problem.  I was actually trying to find the errata
too, so thanks for that.

The example compiles but it throws an exception:

>> echo 3 4 6.6 7.7 33.4 | ./t1 Min Max Average
object.Exception at 3030object.Exception@30
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101223/bd2de6a0/attachment.html>


More information about the Digitalmars-d mailing list