首页 > 代码库 > c#数组
c#数组
00x1 【一维数组】
数组是多个相同类型的数据组合。数组属引用类型。
一维数组的声明:
int [] a; //前面加修饰符然后加中括号,a为数组名。注意括号是写在数组名的前面的。
数组的初始化:
int [] w=new int[3];
w[0]=222;
w[1]=333;
w[2]=666;
或
MyDate [] w; //MyDate是对象型的。
dates = new MyDates[3]; //定义这个对象的长度为3
dates[0] = nenw MyDates[1,2,3,];
dates[1] = new MyDates[2,3,4];
dates[2] = new MyDates[3,4,5]; //默认是从零开始。
c#数组
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。