I would say that its best to model your data structure to suit the real world entity that you're modelling, i.e. a chess board, would require a 2d matrix.
yes, it is wrapped in a class but was wondering if 2D stuff was actually stored in 1D arrays in the industry for speed or something but apparently not..
Whether you declare you array as 1d, 2d, or nd, the array itself is stored in contiguous memory so technically its a 1d array. If you declare a 2d array you can still access it using a pointer to its index in memory as if it's a 1d array.
I would say that its best to model your data structure to suit the real world entity that you're modelling, i.e. a chess board, would require a 2d matrix.
OK let me call the fight off.
Thanks for the info though. All of you.
I think that a 2D array makes more sense than a 1D one to describe something that is 2D in nature. Stack-wise / performance-wise and everything else-wise there is NO difference so it's just up to the programmer.
Basically the ONLY difference is that if you declare it as 2D for a 2D-type object, you avoid having to do the index to coordinates and coordinates to index yourself.
On the other end, if you declare a 2D array for a 1D-type object things are gonna get crazy crazy crazy.