declaration/initialization of multidimensional arrays

bearophile bearophileHUGS at lycos.com
Sun Nov 18 16:53:53 PST 2012


Tyro[17]:

> What is the proper way to declare a multidimensional array?
> In Java, I can do:
>
> 	double[][] a = new double[M][N];

In D (hopefully I have not swapped the to sizes, it's a too much 
common mistake in my D code):

auto a = new double[][](M, N);

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list