www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - wrapping a void* by a ubyte[] array?

reply teo <teo.ubuntu yahoo.com> writes:
Is there any way of wrapping a void* by a ubyte[] array? The void* comes 
from mmap.
Jul 14 2011
next sibling parent "Simen Kjaeraas" <simen.kjaras gmail.com> writes:
On Thu, 14 Jul 2011 17:07:20 +0200, teo <teo.ubuntu yahoo.com> wrote:

 Is there any way of wrapping a void* by a ubyte[] array? The void* comes
 from mmap.

byte[] array = cast(ubyte[])mmap(addr, length, ...)[0..length;] -- Simen
Jul 14 2011
prev sibling parent "Daniel Murphy" <yebblies nospamgmail.com> writes:
Cast to ubyte* and slice?

ubyte[] array = (cast(ubyte*)pointer)[0..length];

"teo" <teo.ubuntu yahoo.com> wrote in message 
news:ivn0n8$14ig$1 digitalmars.com...
 Is there any way of wrapping a void* by a ubyte[] array? The void* comes
 from mmap. 

Jul 14 2011