multi-dimensional array whole slicing

kinke via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 22 15:25:58 PDT 2017


On Saturday, 22 April 2017 at 20:51:46 UTC, XavierAP wrote:
> I can do:
>
> int[3] arr = void;
> arr[] = 1;
>
> But apparently I can't do:
>
> int[3][4] arr = void;
> arr[][] = 1;
>
> What is the best way? What am I missing?

int[3][4] arr = void;
(cast(int[]) arr)[] = 1;
assert(arr[3][2] == 1);


More information about the Digitalmars-d-learn mailing list