On Sunday, March 04, 2012 22:58:08 maarten van damme wrote:
> -how to convert c strings to d strings

Use std.conv.to.

auto str = to!string(cstr);

> -how to avoid having to call tostringz all the time

You're probably out of luck on this one. If you're passing a string to C, you 
need to convert it to a C string, which means that it needs to be zero-
terminated. The only strings in D which are automatically zero-terminated are 
string literals.

- Jonathan M Davis

Reply via email to