Re: multi-dimensional dynamic arrays

2016-02-19 Thread Jay Norwood via Digitalmars-d-learn
On Friday, 19 February 2016 at 14:26:25 UTC, Steven Schveighoffer wrote: Try ub[0].length = 3. You are trying to change the length on one of the static arrays. yes, right these compile. I was surpised it wouldn't accept the append with just an int. int[1][][1] ubb;

Re: multi-dimensional dynamic arrays

2016-02-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/19/16 8:53 AM, Jay Norwood wrote: On Friday, 19 February 2016 at 07:59:29 UTC, Jonathan M Davis wrote: .. Or you could do something really wonky like auto arr = new int[][2][](5); which would be a dynamic array of length 5 which holds static arrays of length 2 which hold dynamic

Re: multi-dimensional dynamic arrays

2016-02-19 Thread Jay Norwood via Digitalmars-d-learn
On Friday, 19 February 2016 at 07:59:29 UTC, Jonathan M Davis wrote: .. Or you could do something really wonky like auto arr = new int[][2][](5); which would be a dynamic array of length 5 which holds static arrays of length 2 which hold dynamic arrays which are null. In my case, int

Re: multi-dimensional dynamic arrays

2016-02-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, February 19, 2016 06:54:51 Jay Norwood via Digitalmars-d-learn wrote: > Strange to me that this compiles, since I would expect there to > be some C-like limitation on the position of the unspecified > dimension. Is allowing this somehow useful? > > int[1][][1] ub; > writeln("ub",ub);

multi-dimensional dynamic arrays

2016-02-18 Thread Jay Norwood via Digitalmars-d-learn
Strange to me that this compiles, since I would expect there to be some C-like limitation on the position of the unspecified dimension. Is allowing this somehow useful? int[1][][1] ub; writeln("ub",ub);