Using char* and C code

Jeremy DeHaan dehaan.jeremiah at gmail.com
Wed Mar 6 23:19:57 PST 2013


> That's what toStringz is for, and it'll avoid appending the 
> '\0' if it can
> (e.g. if the code unit one past the end of the string is '\0' 
> as it is with
> string literals).
>


I actually have a different question related to this now that I 
think about it. Is there a similar function to go from a '\0' 
terminated char* to a D string? Lately I have been using 
std.conv.text, but I have also made a function that just parses 
the pointer and copies its data into a string. I'm actually kind 
of surprised that there isn't anything built into the string 
class like this.


More information about the Digitalmars-d-learn mailing list