byte* and int length -> byte[]

David Nadlinger see at klickverbot.at
Mon Aug 15 10:21:38 PDT 2011


On 8/15/11 7:16 PM, mimocrocodil wrote:
> Can I convert this into byte[] without explict copying etc.
> […]
> byte* p; // bytes
> int size; // size of bytes block

Simply slice the pointer: p[0 .. size]

David


More information about the Digitalmars-d-learn mailing list