title: C# 3 dimensional array
body: <p>I want to store ARRAY from 3 dimensional array into buildingCostIds, but it says I MUST have 3rd number.</p>
  
  <pre><code>public static int[, ,] buildingCost = { {{0,1,2},{5,5,5}}};
  
  public static void addBuilding(int[] ids, int[] amounts, int buildingId)
  {
      int[] buildingCostIds = buildingCost[buildingId, 0, *];
  }
  </code></pre>
  
  <p>*I need third number here, but I don't want it because it will extract just number, I want whole array!</p>
  
  <p>PROBLEM SOLVED, solution:</p>
  
  <pre><code>public static Array extractArray(int dim1, int dim2)
  {
      int[] tempArray = { };
  
      for (int number=0;number&lt;=2; number++)
      {
      tempArray[number] = buildingCost[dim1, dim2, number];
      }
      return tempArray;
  }
  </code></pre>