+ 2

[Ansured] Definition problem

I'm assigned to make an 4x4 array. What do you think, is it this array int arr[][] = new int{{1,2,4,8}, {1, 3, 5, 7}, {* 4 values*}, {*4 values*}} or a wild array like int arr[][][][] = new int{{{{}}}} --each dimension has another dimension, which has another, which in its turn has another etc etc etc ?

2nd Apr 2017, 12:30 PM
Alex Snaidars
Alex Snaidars - avatar
1 Resposta
+ 10
This is a 4x4 array: int arr[][] = new int{{1,2,4,8}, {1, 3, 5, 7}, {* 4 values*}, {*4 values*}} This is a 4d array: int arr[][][][] = new int[1][1][2][3];
2nd Apr 2017, 1:15 PM
Tashi N
Tashi N - avatar