+ 2

what dose the line "my array[0][2]= 42" mean?

23rd Jul 2016, 5:35 PM
Emad Taheri
Emad Taheri - avatar
4 Answers
+ 5
it adds value of 42 to element in first row and 3. column of 2D Array
23rd Jul 2016, 5:38 PM
Petar Suvajac
Petar Suvajac - avatar
+ 1
it means that we have changed the value of the element which is in [0][2] e.g. if there is an array [][] = {{5,7,4},{3,5,2}} and then we use array[1][2]=8 then the new array will be as below(changed) array[][]= {{5,7,4},{3,5,8}} hopecit helps
23rd Jul 2016, 6:22 PM
Harshil Soni
Harshil Soni - avatar
+ 1
it means you are putting 42 at 1st row and 3rd column in 2D array.
23rd Jul 2016, 8:36 PM
Aditya Ghodela
Aditya Ghodela - avatar
0
It means assigning the value 42 to the element referenced by the indices in a two dimensional array of type int.
24th Jul 2016, 12:08 AM
Eric Gitangu
Eric Gitangu - avatar