char[]/ubyte[] compile error

John Colvin via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Jul 13 06:02:23 PDT 2017


On Thursday, 13 July 2017 at 09:51:00 UTC, Jacob Carlborg wrote:
> On 2017-07-12 23:14, Damien Gibson wrote:
>> [...]
>
> Perhaps you can declare a struct that contains a pointer and 
> the length of the array. This is the internal representation of 
> an array in D [1]. The struct would look like:
>
> Array
> {
>     size_t length;
>     char* ptr;
> }
>
> [1] http://dlang.org/spec/abi.html#arrays

I do this for interacting with Cython and it works well for me.


More information about the digitalmars-d-ldc mailing list