Initializing an associative array into a variable when it is created

Danilo codedan at aol.com
Sat Jul 15 23:48:39 UTC 2023


On Saturday, 15 July 2023 at 23:24:27 UTC, Alexander Zhirov wrote:
> There are the same number of elements everywhere (in the 
> internal array).

Sorry, forgot that part.

Just add the size of the internal array (2 in this case):
```d
     string[2][string] arr = [
         "one": ["abc", "def"],
         "two": ["ghi", "jkl"],
         "three": ["mno", "pqr"]
     ];
```



More information about the Digitalmars-d-learn mailing list