On Tuesday, 23 January 2024 at 18:15:29 UTC, Stephen Tashiro
wrote:
If the constructor of a class needs to create an array of
structs whose dimensions are inputs, what's the syntax for
doing this?
For a non-example, the following program errors in main()
because in t.array[][] "index [0] is o
On Tuesday, 23 January 2024 at 19:32:31 UTC, Stephen Tashiro
wrote:
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 tha
On Tuesday, January 23, 2024 12:32:31 PM MST Stephen Tashiro via Digitalmars-
d-learn wrote:
> 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
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_dimens
On Tuesday, 23 January 2024 at 18:15:29 UTC, Stephen Tashiro
wrote:
If the constructor of a class needs to create an array of
structs whose dimensions are inputs, what's the syntax for
doing this?
For a non-example, the following program errors in main()
because in t.array[][] "index [0] is o
If the constructor of a class needs to create an array of structs
whose dimensions are inputs, what's the syntax for doing this?
For a non-example, the following program errors in main() because
in t.array[][] "index [0] is out of bounds".
import std.stdio;
struct Point
{
uint