Reuse C memory for D struct?

Lemonfiend lemon at fie.nd
Mon Nov 25 10:36:06 PST 2013


On Monday, 25 November 2013 at 17:57:21 UTC, Dicebot wrote:
> On Monday, 25 November 2013 at 17:38:00 UTC, Lemonfiend wrote:
>> &_this
>> vs
>> _this.ptr
>>
>> I had thought those would give the same result, but apparently 
>> not?
>
> Think about slice as a struct with two fields - data pointer 
> and data length. `&slice` gives pointer to struct itself, 
> `slice.ptr` yields data pointer.

That's very clear, thanks!


More information about the Digitalmars-d-learn mailing list