码迷,mamicode.com
首页 > 编程语言 > 详细

C#多维数组与嵌套数组

时间:2016-12-13 23:08:57      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:string   system   写法   bsp   维数   矩阵   style   space   nbsp   

using System;

namespace abc.e.f//等价于下面分层嵌套的写法。且这种写法不管命名空间abc有没有定义过,也不管命名空间e有没有定义过
{
    class MYTestX
    {
        static void Main(string[] args)
        {
            int[,] matrix = new int[2, 5];//多维数组。只是从维度上增加,并不是数组嵌套。有点像多维矩阵

            int[][] mt1 = new int[2][];//数组的数组,有两个元素,每个元素是一个数组。相当于嵌套数组。有点像二叉链表

            mt1[0] = new int[5];
            mt1[1] = new int[4];
            int[,,,] mt = new int[2, 3,4, 5];//数组的数组,多重嵌套数组。
        }
    }

}

 

C#多维数组与嵌套数组

标签:string   system   写法   bsp   维数   矩阵   style   space   nbsp   

原文地址:http://www.cnblogs.com/timeObjserver/p/6172195.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!