Constructing arrays of structs
Stephen Tashiro
tashiro at zianet.com
Tue Jan 23 19:32:31 UTC 2024
On Tuesday, 23 January 2024 at 18:23:22 UTC, Renato wrote:
> This works , your mistake was to not actually assign the array
> to the class' field!
>
> Change this line:
>
> ```d
> auto array = new Point[][](the_dimension,the_dimension);
> ```
>
> To this:
>
> ```d
> this.array = new Point[][](the_dimension,the_dimension);
> ```
Thank you.
I don't really understand what the syntax
new Point[][](the_dimension,the_dimension);
denotes. Does it represent a function? To look up this topic,
what are the proper keywords?
By experimentation, I found that "new
Point[the_dimension][the_dimension];" doesn't compile.
More information about the Digitalmars-d-learn
mailing list