arrays in DMD V2

Jesse Phillips via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 18 18:13:53 PDT 2014


On Saturday, 19 April 2014 at 00:27:32 UTC, steven kladitis wrote:
> import std.stdio;
>
>
> void main()
> {
>
> int    a0[];
> int    a1[][];
> string a2[][];
> string a3[][string];
> string a4[][string][string];
> //string a4[string][string][string]; is this the same as 
> above????
> int    a5[][string][string][string];
> int    a6[string][int][string][float];
> int    a7[int][int][string];
>
> // how do you initialize each array, what type are they 
> multidimensional???
> // how do you define all of the above with limits on each 
> dimension???
> }
>
> //help please

First, don't use that syntax. everything should be placed on the 
type:

Second,

void main() {
     int    a5[][string][string][string];
     pragma(msg, typeof(a5));
}

Third,

http://dlang.org/arrays.html
http://dlang.org/hash-map.html


More information about the Digitalmars-d-learn mailing list