byte to char safe?

Ary Borenszweig ary at esperanto.org.ar
Thu Jul 30 16:00:52 PDT 2009


Harry escribió:
> Again hello, 
> 
> char[6] t = r"again" ~ cast(char)7 ~ r"hello";

If you want the result to be "again7hello", then no. You must do:

char[6] t = r"again" ~ '7' ~ r"hello";

or:

char[6] t = r"again" ~ (cast(char)('0' + 7)) ~ r"hello";


More information about the Digitalmars-d-learn mailing list