Re: [Vala] how to access the length attribute of multi dimensional arrays?



Hey,

I've no experience with Multi-Dimensional arrays in Vala, but I can quote a
tutorial:
http://live.gnome.org/Vala/ValaForJavaProgrammers#Arrays

It provides the basics of Vala for Java programmers (me.. in college ;-(
but also has a piece that might be of intrest to you.

HTH, -Harry

On Fri, Jul 2, 2010 at 12:26 AM, Seth Hoenig <seth a hoenig gmail com>wrote:

So if I pass a matrix to a function (or any multidimensional array), I can
only seem to access the .length attribute of the first dimension. Is there
a
way to access the .length attributes of the other dimensions of the array?

public Something(int[,] arr)
{
_n_rows =  arr.length;
_n_cols =   arr[0, ].length; // no compile :(
}

In the example above, I can't seem to find a way to find out how many
columns are in my matrix.

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list




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