Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multi dimansional Array,Master Exam

 
Mushraf Khan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GoodDay EveryOne

This is from Master Exam A ,
Can anyone please clear the the below query. I tried to read some of the post based on this question, got more confused. Can anyone please help me with my below quoted queries. i would really apprecaite. I really need your great help to make this cleared.

A,B,E,F are correct.


A. b2[1][1] = big;----- I guess there are 4 arrays in b2, what does b2[1][1] mean
B b[1][]0] = b3; --- second array, O th element , means second array of b, value of element at index 0 . is this correct
C b2[0][1][1] = b ----- Couldnt figure how b2[0][2][1] has come
D b2[0][2][1] = b[1][0]---- Couldnt figure how this came
E b2[1][1][0][1] = b[1][0] -----Couldnt figure how this came
F b2[1][1] = b ------Couldnt figure how this came
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the answers as comments in the below program.

 
Mushraf Khan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot John. Had always the problem of arrays when it was more than one dimensional. The explaination was crystal clear. Earlier i used to count dont know what in the [] and tried to figure out some logic. This was really clear. Sorry for the late reply , been bit busy with my kids activities.
Thanks again.


Regards
Mushraf Khan
 
Ankit Garg
Sheriff
Posts: 9593
34
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As John explained already you should think of two dimensional arrays as array of arrays, you can read a tutorial like this on this. That is the only reason why its possible to have a two dimensional array with each 'row' having different number of 'columns'...
 
Mushraf Khan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a Lot, Ankit Garg. It was really useful information. Broadened my knoweldge about Arrays and best of all understood it. Thanks again.
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!