int[, ,] array3D = new int[,,] { { { 1, 2, 3 } }, { { 4, 5, 6 } } };
Console.WriteLine("The elements of the 3 dimensional array are 
                     {0} {1} {2} {3} {4} {5}.",
                    array3D[0][0][0], 
                    array3D[0][0][1], 
                    array3D[0][1][0], 
                    array3D[0][1][1],
  array3D[0][2][0], 
                    array3D[0][2][1]);
编译时,提示如下error:
[] 内索引数错误,应为“3”点击错误时,提示指向了第二维索引

解决方案 »

  1.   

    和定义时一样写array3D[0,0,0]  
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 最新版本:20070212http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  2.   

    int[, ,] array3D = new int[0,3,2] 
    array3D[0,0,0]=1;
    array3D[0,0,1]=2;
    ......
      

  3.   

    数组变量需要提前定义好个数
    int[] a = new int[] ----错误
    int[] a = new int[3] ---正确
      

  4.   

    jone_fox()的声明是错误的
    正确:The length of the first dimension is 2
         The length of the second dimension is 1
         The length of the first dimension is 3int[,,] array3D = new int[2,1,3] { { { 1, 2, 3 } }, { { 4, 5, 6 } } };
    Console.WriteLine("The elements of the 3 dimensional array are :
                        {0} {1} {2} {3}  {4} {5}.", 
       array3D[0,0,0], 
                         array3D[0,0,1], 
                         array3D[0,0,2], 
                         array3D[1,0,0],
       array3D[1,0,1], 
                         array3D[1,0,2]);
    请大家放心,上面的代码已运行通过!!!
      

  5.   

    sorry,没仔细看.
    但表达的主要意识就是:"数组变量需要提前定义好个数".
      

  6.   

    谢谢楼上的~
    请问怎么样导入dxf格式的三维数据呢??