[Ansured] Definition problem | Sololearn: Learn to code for FREE!

+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 ?

4/2/2017 12:30:12 PM

Alex Snaidars

1 Answer

New Answer

+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];