Help with multi-dimentional array

Koroskin Denis 2korden at gmail.com
Thu Jul 10 04:29:07 PDT 2008


On Thu, 10 Jul 2008 03:59:13 +0400, torhu <no at spam.invalid> wrote:

> Era Scarecrow wrote:
>   Now let me doublecheck once more. If i DID this.
>>   abc = new xyz[][](4,4);    //Non-stack and GC handles it, or i can  
>> malloc
>>  abcd [4][4]xyz;    //(Stack / non-Stack) static allocation
>>   I'll assume that
>>  1) abcd is an array of 4 pointers that have 4 pointers each
>>  2) It is not created by the GC, but instead resides on the Stack?  
>> (Please confirm)
>
> You probably meant this:
>
> xyz[4][4] abcd;
>

IIRC, both syntaxes are allowed, but "xyz[4][4] abcd;" is prefered.


More information about the Digitalmars-d-learn mailing list