hey guys

How do u define a 2by 5 array..is it mean

int t [2][5]..

how do u figure out how many elements in the array?

>>How do u define a 2by 5 array..is it mean
Yes you are right.

>>how do u figure out how many elements in the array?
first dimension times second dimenson. Very similar to a chess board where there are 8 rows and 8 columns, which means there are 64 squares. That's the same identical concept with 2d arrays. In your example 2 X 5 = 10 elments.

Thanks man


So it means that it have 2 rows and 5 columns??

and do u know how to name the elements in a row.as a example in the second row

will it be like following?

t[1][0]
t[1][1]
t[1][2]
t[1][3]
t[1][4]

Yes, again. Looks like you have it figured out.

thnks dude

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.