June 04, 2021

Consider initializing a dictionary or associative array :

T[U] AA;

For example :

double [int] AA;

This will be dynamic in size.

Now consider initializing a dynamic array :

T[] A = new T[] (0);

or

U[][] B = new U [][] (0,0);

This will also be dynamic in size.

In my untrained eye, this seems haphazard. One requires the use of the new keyword, the other does not. Why is it? Has It got something to do with random access mechanism? I would like to know the rationale please.

June 04, 2021

On Friday, 4 June 2021 at 11:27:05 UTC, seany wrote:

>

In my untrained eye, this seems haphazard. One requires the use of the new keyword

It doesn't.

T[] a;

just works. it is an array of length 0.