char e string em linguagem D

crimaniak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 14 08:20:47 PDT 2017


On Thursday, 13 July 2017 at 22:36:47 UTC, Basile B. wrote:
>>       return cast(char[])`
...
> Never cast a literal to char[]. modifying the resulting char[] 
> will lead to AV, at least under linux.  `.dup` the literal if 
> you really needs char[].

Hmm, yes, my bad. Probably, it was necessary even for this simple 
example to write const char[].


More information about the Digitalmars-d-learn mailing list