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



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.


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