allocate an array of AA?
sa
no at where.com
Sat Mar 8 12:18:44 PST 2008
== Quote from bearophile (bearophileHUGS at lycos.com)'s article
> sa Wrote:
> > How to allocate an array of AA?
> > I tried two ways (new, and setting array length), in both cases the code
> > compiles, but the executable seems run into infinite loop, and never finish.
> It's a bug of DMD. I think you have to use a loop with a creation followed by an
append (~=) to the array.
But how to write such 'a creation'? i.e. how to new an AA? what's the syntax?
tried:
int[int]* mapsp;
mapsp = new int[int]; // this line
The compiler complains: need size of rightmost array, not type int
More information about the Digitalmars-d
mailing list