Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Is this what you're looking for?</p> <pre><code>class Program { public static void Main() { var hey = new int[][] { new int[]{11, 12, 13}, new int[]{21, 22, 23}, new int[]{31, 32, 33}, }; foreach (var row in hey) { foreach (int i in row) { Console.Write("{0} ", i); } Console.WriteLine(); } Console.ReadLine(); } } </code></pre> <p>The idea is that you have an array of arrays. var hey = new int[][], means you're creating an "int array, array" (int[][]). When you want to access one of the elements you would write</p> <pre><code>var myElement = hey[x][y]; </code></pre> <p>where x is the row, and y is the integer in the y column on that row.</p> <p>Hope this helps :)</p> <p>Edit:</p> <p>I see now that you wanted multi-dimensional arrays. I missed that to begin with. You've already posted a solution for that, but to make my answer complete, you can also instantiate multidimentional arrays like so (three-dimensional integer array):</p> <pre><code>public static void Main() { var hey = new string[,,] { { { "000", "001", "002" }, { "010", "011", "012" }, { "020", "021", "022" }, }, { { "100", "101", "102" }, { "110", "111", "112" }, { "120", "121", "122" }, }, { { "200", "201", "202" }, { "210", "211", "212" }, { "220", "221", "222" }, }, }; for (int x = 0; x &lt; 3; x++) { for (int y = 0; y &lt; 3; y++) { for (int z = 0; z &lt; 3; z++) { Console.WriteLine("{0}{1}{2} = {3}", x, y, z, hey[x, y, z]); } Console.WriteLine(); Console.WriteLine(); } Console.WriteLine(); } Console.ReadLine(); } </code></pre> <p>The problem with using multi-dimensional arrays, is there is no concept of rows or columns within the array (only within the accessor). So there is no built in way to get only the first row, or values in the first column, etc... This makes it difficult (if not impossible) to use with Linq (which is super fancy, but extremely useful).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload