打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
C#数组定义例子
using System;
    class DeclareArrayaSample
    {
        public static void Main()
         {
 
//一维数组
      int[] numbers=new int[5];
//多维数组
      string[,] names= new string[5,4];
//不规则数组
      byte[][] scores=new byte[5][];
//创建不规则数组
      for(int i=0;i<scores.Lenghth;i++)
         {
                scores[i]=new byte[i+3];
         }
//打印每一行的长度
        for(int i=0;i<scores.Length;i++)
       {
           Console.WriteLine("Length of row{0} is {1}",i,scores[i].Length);
 
          }
     }
}
这个例子的输出是:
Length of row 0 is 3
Length of row 1 is 4
Length of row 2 is 5
Length of row 3 is 6
Length of row 4 is 7
 
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
数组下标越界异常
JavaSE| 数组
C#泛型详解
Java中byte数组与long数组相互转化
(一)java数组的语法
614,矩阵置零
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服