From the D Blog -- Interfacing D with C: Strings Part One

Steven Schveighoffer schveiguy at gmail.com
Tue May 25 13:38:56 UTC 2021


On 5/24/21 11:30 PM, surlymoor wrote:
> On Tuesday, 25 May 2021 at 00:58:31 UTC, Steven Schveighoffer wrote:
>> OK, I'm just concerned people will see the pattern:
>>
>> ```d
>> somecfunc(str.toStringz);
>> ```
>>
>> and think that's the end of it.
>>
> 
> Pretty sure its documentation has a conspicuous warning regarding that.

It does, and that's [sometimes 
ignored](https://forum.dlang.org/post/bogwusbqfewqifjlfmjz@forum.dlang.org), 
even by [seasoned 
veterans](https://forum.dlang.org/post/rorsrk$1tdu$1@digitalmars.com).

Anyway, it doesn't hurt to identify the possible memory problems that a 
function can have when recommending it.

-Steve


More information about the Digitalmars-d-announce mailing list