C string to D without memory allocation?

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 20 21:41:31 PST 2015


Rikki Cattermole wrote:

> string myCString = cast(string)ptr[0 .. strLen];

Thanks but does this require that one doesn't attempt to append to the 
returned string using ~= or such? In which case it is not safe, right?

-- 
Shriramana Sharma, Penguin #395953


More information about the Digitalmars-d-learn mailing list