Cast ptr/len to D-style array

James Blachly james.blachly at gmail.com
Fri May 3 03:21:33 UTC 2019


On 5/2/19 4:05 PM, ag0aep6g wrote:
> Just slice the pointer with the length:
> 
>      int* ptr;
>      size_t len;
>      int[] arr = ptr[0 .. len];

Perfect thanks. I searched but without using the magic word "slice" I 
couldn't find meaningful results.

Thanks again.


More information about the Digitalmars-d-learn mailing list