int to char at compile time

Hendrik Renken funsheep at gmx.net
Wed Mar 21 00:14:47 PDT 2007


--------8< snip code 8<----------
> 
> using
> name = "CORE";
> writes to the console
> 
> 100: Testmsg
> 
> 
> using
> name = "\"CORE\"";
> gives me what i want
> 
> CORE: Testmsg
> 
> shouldnt it also work with "CORE"? or am i missing something here?

sorry for bothering, answered the question myself.

Code:
"writefln(\"%s: %s\", "~ name ~", \"" ~ msg ~ "\");"


using name = "CORE";
gives us the line
"writefln(\"%s: %s\", CORE, "Testmsg");"

note: around ~msg~ i inserted " with \"

so this is not "CORE", instead is uses the defined int variable, which 
has (of course) the value 100. giving

100: Testmsg


More information about the Digitalmars-d-learn mailing list