0

HELP ME PLZ

int[ ][ ] myArr = { {1, 2, 3}, {4}, {5, 6, 7} }; myArr[0][2] = 42; int x = myArr[1][0]; // 4 what is the meaning of second line code? what does this do for?

17th Jun 2017, 7:49 AM
Hyun Chang Lee
Hyun Chang Lee - avatar
3 odpowiedzi
+ 1
It re-assigns the value in the [0][2] position of the myArr. [0] being the first sub array of myArr and [2] being the 3rd element of that sub array. So 3 should now be 42.
17th Jun 2017, 7:56 AM
ChaoticDawg
ChaoticDawg - avatar
+ 14
Edits the value of the third item of the first array inside myArr array.... (multidimensional array/Array inside array...)
17th Jun 2017, 7:54 AM
Valen.H. ~
Valen.H. ~ - avatar
0
Thank you for helping me, both of you :)
17th Jun 2017, 8:04 AM
Hyun Chang Lee
Hyun Chang Lee - avatar