For example:
array<array<int>> arr;
arr[0] = {0};
gets me a:
ERR : Expected expression value
[/quote]
I tried other ways, like arr[0].insertLast(0); or even arr.resize(1); arr[0]...; none seems to work.
How is it supposed to work?
array<array<int>> arr;
arr[0] = {0};
ERR : Expected expression value
[/quote]
I tried other ways, like arr[0].insertLast(0); or even arr.resize(1); arr[0]...; none seems to work.
How is it supposed to work?
array<array<int>> arr;
arr.resize(10);
arr[0].resize(10);
arr[0].insertLast(0);
arr[0][0] = 52;
array<array<int>> arr1 = {{0,0}, {1,1}}; // a 2 by 2 array, fully initialized
array<array<int>> arr2(2); // a 2 by 0 array
arr2[0] = array<int>(2, 0); // first row is now 0, 0
arr2[1] = array<int>(2, 1); // second row is now 1, 1
array<array<int>> arr3(2, array<int>(2, 0)); // a 2 by 2 array. all elements are 0
arr3[1] = array<int>(2, 1); // fully initialized
array<array<int>> arr4; // a 0 by 0 array
arr4.resize(2); // a 2 by 0 array
arr4[0].resize(2);
arr4[1].resize(2); // a 2 by 2 array
arr4[0][0] = 0;
arr4[0][1] = 0;
arr4[1][0] = 1;
arr4[1][1] = 1; // fully initialized
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game