0

Hey everyone! If I have a matrix as follows:

int[][] mat = new int[5][3];

Does that mean that the row size is 5 and the column size is 3 or vice-versa? I am really confused about whether the order is [row][col] or whether it is [x][y] in relation to the x-y plane, which would be [col][row].

Can someone please explain?

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by masijade
0

Doesn't really matter. You can refer to it either way you want, just make sure that you do it the same everywhere in the program, and if the structure is to become "public", make sure that the "direction" is documented.

0

I would assume x,y (i.e. col, row) since that is what x, y is, and how they are normally referenced. But is there some sort of standard, haven't got a clue, as it doesn't matter anyway.

If you are uncertain of a specific third-party library you're using, then use that library with a known set of data, and find out which is which.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.