initializing static rectangular arrays

Janice Caron caron800 at googlemail.com
Sat Nov 17 13:35:45 PST 2007


On 11/17/07, llee <llee at goucher.edu> wrote:
> how do you initialize a static multidimensional array? I tried the following, but it did not work.
>
> float[3][4] array =
> [
>    [1.1, 1.2, 1.3],
>    [2.1, 2.2, 2.3],
>    [3.1, 3.2, 3.3]
> ];

Isn't that a 3x3 array, not a 3x4 array?

Anyway, I think the solution to your dilemma is the keyword "const".
(Or if that doesn't work, try "static").



More information about the Digitalmars-d mailing list