Why is readf not returning a value?
Asked Answered
G

1

5

According to the documentation, readf is supposed to return a uint. But even this simple example fails to compile:

hello.d

import std.stdio;

void main() {
    int x;
    uint r = readf("%s", &x);    
}

error message:

hello.d(5): Error: expression readf("%s",& x) is void and has no value

Am I missing something here?

I'm using dmd (Digital Mars D) compiler v2.050.

Galateah answered 31/3, 2011 at 20:23 Comment(0)
M
9

You're missing a new version of DMD. This bug was fixed (silently) in v2.052 (at commit 86a080f).

Margartmargate answered 31/3, 2011 at 20:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.