Re: AA with dynamic array value

2016-07-05 Thread Craig Dillabaugh via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 02:33:02 UTC, ketmar wrote: On Wednesday, 6 July 2016 at 02:19:47 UTC, Craig Dillabaugh wrote: [...] this is true for any dynamic array, including AAs. until something is added to array, it actually a `null` pointer. i.e. arrays (and AAs) generally consisting of

Re: AA with dynamic array value

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 02:19:47 UTC, Craig Dillabaugh wrote: Why doesn't my function allow me to insert elements into an empty associative array, but succeeds for an AA with some element in it? this is true for any dynamic array, including AAs. until something is added to array, it

Re: AA with dynamic array value

2016-07-05 Thread Craig Dillabaugh via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 02:03:54 UTC, Adam D. Ruppe wrote: On Wednesday, 6 July 2016 at 01:58:31 UTC, Craig Dillabaugh wrote: *(keyvalue) ~ value; // This line fails. That should prolly be ~= instead of ~. Ahh, I was so close. Thank you that seems to do the trick. However,

Re: AA with dynamic array value

2016-07-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 01:58:31 UTC, Craig Dillabaugh wrote: *(keyvalue) ~ value; // This line fails. That should prolly be ~= instead of ~.

AA with dynamic array value

2016-07-05 Thread Craig Dillabaugh via Digitalmars-d-learn
How can I create (and update) and associative array where the key is a string, and the value is a dynamic array of integers? For example: void insertValue( int[][string]aa, string key, int value ) { int[]* keyvalue; keyvalue = ( key in aa ); if ( keyvalue !is null ) {