My new least favorite one-liner...

bearophile bearophileHUGS at lycos.com
Sat Nov 5 03:38:04 PDT 2011


Jude Young:

> icon = *(toStringz(text(num)));
> 
> icon is a char, num is an integer.

Are you trying to convert a single-digit number?

import std.stdio;
void main() {
    int x = 5; // in [0 .. 10]
    char c = cast(char)(x + '0');
    writeln(c);
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list