Error: unsupported char 0x03

Agustin agustin.l.alvarez at hotmail.com
Tue Oct 22 08:06:37 PDT 2013


On Tuesday, 22 October 2013 at 15:05:16 UTC, Adam D. Ruppe wrote:
> On Tuesday, 22 October 2013 at 15:01:20 UTC, Agustin wrote:
>>        = "public immutable(int) getId() const { \n" ~ id ~ "; 
>> \n}";
>
> You'll probably want to convert id to a string there
>
> import std.conv;
>
>  "public immutable(int) getId() const { \n" ~ to!string(id) ~ ";
>
> and also put in return for that function:
>  "public immutable(int) getId() const { \n return " ~ 
> to!string(id) ~ ";
>
>
> and it should compile. What was happening before is string ~ 
> int implicitly converts the int to a char, and cast(char)(3) 
> isn't a printable character, and isn't allowed in D source code.

Works great, thanks! :)


More information about the Digitalmars-d-learn mailing list