noob Q: array out-of-range

bearophile bearophileHUGS at lycos.com
Fri May 28 16:59:27 PDT 2010


Duke Normandin:

> This is the site that I'm using to learn D. If you scroll down 3-4
> screens full, you'll come to the "array" topic. Is this tutorial
> outdated, wrong, or what, because it doesn't deem to sync with what
> you two fine fellows are telling me about creating dynamic arrays in
> the D-Language. TIA..

That part of that tutorial is not outdated, as far as I know it's just wrong.
You can auto-create slots in associative arrays:

int[int] aa;
aa[0] = 1;
aa[1] = 1;
aa[2] = 1;

Lua language uses associative arrays instead of arrays :-)

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list