C#数组
发布日期:2021-06-30 19:10:41 浏览次数:2 分类:技术文章

本文共 719 字,大约阅读时间需要 2 分钟。

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 };    }}
 

转载地址:https://linuxstyle.blog.csdn.net/article/details/1539762 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:C#数组篇讲解
下一篇:HashTable的使用示例

发表评论

最新留言

关注你微信了!
[***.104.42.241]2024年05月04日 13时54分17秒