Simple array init question
Graham
grahamamacdonald at gmail.com
Sun Apr 8 03:03:33 PDT 2007
As I said before, I could use a normal 1D array. My basic point is that
as I was trying to initialise a static, rectangular array, there's no
reason (that I can see) why the initialiser can't work for more than 1D.
(And to be pedantic, int[5][5] is a 2D rectangular array, which in
memory is exactly the same as int[25] - a 1D array, of course - so six
of one and half a dozen of the other perhaps, but int[5][5] does have >
1 dimension :-))
(Thanks for the previous recommendations though!)
g
Daniel Keep wrote:
> You *don't* have more than one dimension; you're really nesting arrays.
> Strictly speaking, int[5][5] is an (albeit static) jagged array.
>
> I realise that for your purposes, it's six of one, half a dozen of the
> other -- I'm just being pedantic :)
>
> -- Daniel
More information about the Digitalmars-d
mailing list