What does it mean when there is a comma inside an array declaration? e.g. float[,]
C#ArraysDeclarationC# Problem Overview
I have some code I'm trying to understand while learning C#. I do not understand what I even need to search Google for to get here, but the code is as follows:
float[,] heightAll = terData.GetHeights(0, 0, allWidth, allHeight);
Why does the array declaration have a comma in between the brackets?
C# Solutions
Solution 1 - C#
That would be a two-dimensional array. You can also specify more dimensions:
Solution 2 - C#
Each comma adds an additional dimension to the array [,] = 2 dimensional [,,] = 3 dimensional ...
Solution 3 - C#
That the array is multi-dimensional - two-dimensional in your case.
Solution 4 - C#
It means it is a multidimensional array.
See MSDN.