Are there accepted names for the two types of arrays in a multidimensional array?

Sorry if this question is a bit elementary, but I was wondering if there are names for the different arrays in a 2D array. For example, in:

int[][] array = new int[5][10];

What do I call the array with the length of 5? And what about the arrays with the length of 10? I was thinking something like the "primary array" and "secondary array" since the secondary arrays are stored in the primary array...

Any thoughts?

Answers


When looking at a multidimensional array (an array of arrays), the first length is the amount of rows there are. The second length is the amount of columns. So typically, say if running through a for loop, you could refer to them as such.

An example of a multidimensional array int [][] arr = new int[2][3] could look like:

[1, 2, 3] [4, 5, 6]

So there are [2] rows, of [3] columns.


Need Your Help

Pass two defferent parameters in URL to filter data

php html

I have something like an e-commerce website , where i can filter products by category and by price, views ,date, and likes.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.