www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - About std.stdio.File.writef

With dmd 2.048 this code:

import std.stdio: File;
void main() {
    auto f = File("TEST.ppm", "w");
    f.writef("%c", 50);
}


Prints at run-time:
std.format.FormatError: std.format integral

So to write a char I've had to use:
f.write(cast(char)50);


Partially unrelated: is is possible to perform something like f.readfln()? Do I
have to use std.conv.parse for it?

Bye and thank you,
bearophile
Sep 03 2010