How to ensure string compatibility In D?

FrankLike 1150015857 at qq.com
Thu Jan 24 06:41:30 UTC 2019


On Wednesday, 23 January 2019 at 14:12:09 UTC, Jonathan M Davis 
wrote:
> On Wednesday, January 23, 2019 5:42:55 AM MST FrankLike via

> std.conv.to will allow you to convert between string and 
> wstring, but for calling C functions, you still need the 
> strings to be zero-terminated unless the function specifically 
> takes an argument indicating the number of characters in the 
> string. Strings in D are not zero-terminated, so std.conv.to is 
> not going to produce strings that work with C functions. 
> std.conv.to and std.utf.toUTFz solve different problems.
>
> [...]

Thank you.


More information about the Digitalmars-d-learn mailing list