My new least favorite one-liner...

Jude Young 10equals2 at gmail.com
Sat Nov 5 21:39:28 PDT 2011


Nice.  Exactly what I was looking for.
I knew I was missing something tiny.

Now I just need to figure out why that works and I can say I've learned
something!
Thanks guys,
Jude

On Sat, Nov 5, 2011 at 5:38 AM, bearophile <bearophileHUGS at lycos.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20111105/02f08feb/attachment.html>


More information about the Digitalmars-d-learn mailing list