multidimensional array

Stefan Frijters via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 28 01:47:48 PDT 2014


On Sunday, 28 September 2014 at 04:24:25 UTC, Joel wrote:
> I'm trying to make a multidimensional array. I feel I've tried 
> every thing. Is there a good guide explaining it?
>
> struct Spot { bool dot; }
> spots = new Spot[][](800,600);
> 	assert(spots[800-1][600-1].dot, "Out of bounds");

You could also take a look at unstd.multidimarray (not my work, 
but I'm using it extensively at the moment)[1].

[1] 
http://denis-sh.bitbucket.org/unstandard/unstd.multidimarray.html


More information about the Digitalmars-d-learn mailing list