On Thursday, 25 January 2024 at 20:36:49 UTC, Kagamin wrote:
On Thursday, 25 January 2024 at 20:11:05 UTC, Stephen Tashiro
wrote:
void main()
{
ulong [3][2] static_array = [ [0,1,2],[3,4,5] ];
static_array[2][1] = 6;
}
The static array has length 2, so index 2 is out
Can the elements of an array be accessed with a pointer using the
usual indexing notation (e.g."[2][0]") for array elements? - or
must we treat the elements associated with the pointer as
1-dimensional list and use pointer arithmetic?
A more elementary question is why array index 2 is out-of-b
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
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