Array of array

Jonathan M Davis jmdavisProg at
Mon Jan 2 16:16:46 PST 2012

On Monday, January 02, 2012 23:49:36 Manfred Nowak wrote:
> RenatoL wrote:
> > Error: new can only create structs,
> > dynamic arrays or class objects, not int[][]'s
> There is an error in the error message:
>   new can only create _static_ arrays.

Um no. new is used for creating _dynamic_ arrays, not static arrays. Static 
arrays normally go on the stack.

int[5] staticArray;
auto dynamicArray = new int[](5);

- Jonathan M Davis

More information about the Digitalmars-d-learn mailing list