O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Multidimensional Arrays

Jagged arrays do not need to (but can) have a rectangular shape, which is what makes them jagged in the first place. In some situations, arrays have a more regular shape, making them amenable to the use of multidimensional arrays. A typical example is a Sudoku challenge, which has nine rows and nine columns:

byte[,] sudoku = new byte[9,9];

The number of dimensions is indicated by writing commas between the square brackets of the array type. When initializing the array, the size of the dimensions is specified. In this particular case, we have two dimensions, but more dimensions are allowed (creating cubes or hypercubes).

Note: Don’t Waste Space

Chapter 27, “Diagnostics and Instrumentation,” discusses code analysis (otherwise ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required