Initialising multidimensional dynamic arrays

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 30 09:07:14 PDT 2014


On Tue, 30 Sep 2014 15:57:57 +0000
Mike James via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> How do I initialise a dynamic array of dynamic arrays?
do you mean something like this: `int[][] a`? if yes, do this:

  auto a = new int[][](42, 69);

and you'll get `int[42][69] a`.

heh, people again confused by `new Type[amount]` syntax. that is
concrete sign that this syntax will live forever.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20140930/ce927bf3/attachment.sig>


More information about the Digitalmars-d-learn mailing list