Initializing an associative array into a variable when it is created

Danilo codedan at aol.com
Sat Jul 15 23:34:22 UTC 2023


Works fine, if you add a semicolon at the end.
```d
import std.stdio;

void main() {
     string[][string] arr = [
         "one": ["abc", "def"],
         "two": ["ghi", "jkl"],
         "three": ["mno", "pqr"]
     ];
     writeln(arr);
     writeln(arr["two"]);
     writeln(arr["two"][0]);
}
```


More information about the Digitalmars-d-learn mailing list