Re: [Vala] how to declare multi-dimensional arrays in Genie?



 On 7/15/2010 7:34 PM, Jamie McCracken wrote:
On Thu, 2010-07-15 at 19:26 -0400, Ron Murawski wrote:

I wanted the multi-dimensional array in the data area, not on the
stack.

In C:

int my_array[64][13];

int main(int argc, **char argv)
{
     my_array[7][7] = 7;
     // more stuff
     return 0;
}
my_array is allocated on the stack in the above example

the previous posts have shown how to do it on the heap (via use of "new
array") but as thats not what you want I would suggest filing a
bug/feature request for vala to support stack allocation of
multi-dimensional arrays

jamie



I am perfectly happy using the heap for multi-dimensional arrays.
I am much too new to the language to be making language feature
requests. Maybe next year... ;-)

Thanks again to everyone!

Ron



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]