What exactly are the String literrals in D and how they work?

rempas rempas at tutanota.com
Sun Aug 15 08:51:19 UTC 2021


On Sunday, 15 August 2021 at 08:47:39 UTC, jfondren wrote:
>
> dup() isn't aware of the NUL since that's outside the slice of 
> the string. It only copies the chars in "John". You can use 
> toStringz to ensure NUL termination:
> https://dlang.org/phobos/std_string.html#.toStringz

Is there something bad than just casting it to `char*` that I 
should be aware of?


More information about the Digitalmars-d-learn mailing list