六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 20|回复: 0

C#数组

[复制链接]

升级  38.7%

580

主题

580

主题

580

主题

探花

Rank: 6Rank: 6

积分
1774
 楼主| 发表于 2013-2-4 22:26:30 | 显示全部楼层 |阅读模式
class TestArraysClass{    static void Main()    {        // Declare a single-dimensional array         int[] array1 = new int[5];        // Declare and set array element values        int[] array2 = new int[] { 1, 3, 5, 7, 9 };        // Alternative syntax        int[] array3 = { 1, 2, 3, 4, 5, 6 };        // Declare a two dimensional array        int[,] multiDimensionalArray1 = new int[2, 3];        // Declare and set array element values        int[,] multiDimensionalArray2 = { { 1, 2, 3 }, { 4, 5, 6 } };        // Declare a jagged array        int[][] jaggedArray = new int[6][];        // Set the values of the first array in the jagged array structure        jaggedArray[0] = new int[4] { 1, 2, 3, 4 };    }}
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表