What does it mean when there is a comma inside an array declaration? e.g. float[,]

ricky picture ricky · Dec 10, 2012 · Viewed 15.9k times · Source

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?

Answer

Justin Niessner picture Justin Niessner · Dec 10, 2012

That would be a two-dimensional array. You can also specify more dimensions:

Multidimensional Arrays (C# Programming Guide)