[Vala] How to initialize a Matrix



hello all,

i try to initialize a simple matrix:

int[,] matrix = new int[,] { {1, 3}, {4, 8} };

like in c# but, valac returns:

/home/matias/vala/test.vala:7.36-7.36: error: too many expressions in initializer list for `int'
...
...
..
and other stuf...

For vector initialization i use:

int[] vector = new int[] {23, 2, 3, 5, 2};

it works, but i wonder if also could be like this:

int[] vector = {23, 2, 3, 5, 2};

like in c#
any help will be useful

Matias









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