-Christian Manning wrote:
>Seems like Node*[] pointers needs to have a defined length before allocating to an index as adding "++pointers.length;" before "pointers[i]=n;" makes it work fine.
Thanks, it works...!
-Denis wrote:
>There is no node in pointers as of now, thus pointers[i] can only be a range violation, whatever i (even 0, which should point to the *first* node).
> pointers[i]=n;
>would *change* the current element number i. To put a *new* node into pointers,
>if that's what you intended, use the '~' appending operator (here in version >'~=');
> pointers ~= n;
Yes, that's exactly what I wanted to do. Thanks...!

>An array does not dynamically adjust its length when you assign an element, you have to assign the length explicitly before-hand. Some dynamic languages do this (like Javascript), but not D.
>>You can achieve this with an associative array:
>>Node*[int] pointers;
>>However, iterating an AA does not guarantee order. So it depends on your requirements.
>>-Steve
Thank you..!. That clarifies the things a lot. :)