Array slice length confusion

Kagamin spam at here.lot
Wed Jul 8 02:04:28 PDT 2009


Kagamin Wrote:

> Tim Matthews Wrote:
> 
> > Was this a design choice, bug, undefined behavior, etc...?
> 
> Design choice. In order to widen slice to should recreate it from the original array.

For this I use begin markers:

ubyte[] buff=new ubyte[100];
int half=buff.length/2;
ubyte[] buff1=buff[0..half];
ubyte[] buff2=buff[half..$];


More information about the Digitalmars-d-learn mailing list