unsafe toString() behavior

lenfestey at geemail.com lenfestey_member at pathlink.com
Mon Jun 26 16:18:15 PDT 2006


import std.stdio;
import std.string;

void main() {
char[] x = toString(0);

// la de da...
x[0] = 'a';

// guess what i print
writefln("x=%s", toString(0));
}

It is because toString(uint) sometimes returns an array slice.

Aaron Lenfestey



More information about the Digitalmars-d-bugs mailing list