Array of array

Timon Gehr timon.gehr at gmx.ch
Mon Jan 2 15:27:35 PST 2012


On 01/03/2012 12:03 AM, RenatoL wrote:
> I have:
>
> auto r = new int[][];
>
> Error: new can only create structs, dynamic arrays or class objects
> , not int[][]'s
>
> while
>
> auto r = new int[][3];
>
> is ok.

new int[][3] is an alternate form of new int[][](3); new int[][3] 
allocates an int[][] with 3 default-initialized elements.


More information about the Digitalmars-d-learn mailing list