C # Simple Array

Source: Internet
Author: User

int[,] a=new int[,]{{1,2},{3,4},{5,6}};//two-dimensional array textbox.text=a[0,1];//=2int[][] b={new int[]{1,2},new int[]{3,4}};// Jagged array textbox.text=b[0][1];//=2-----------
Multidimensional irregular arrays
-------------can have several columns per row, but each column contains the same number.---------------------
int[][,] c=new int[][,]
{New int[,]{{1,3},{5,7}}, New int[,]{{2,4},{6,8}}, new int[,]{{0,10}, {20,30},{1000,2000}};
C[0][0,0]=1
c[2][2,1]=2000
------------------Array Differences--------------------------------------

Int[,] is a two-dimensional array, which is the traditional n x M table, and C + + int[][] is a meaning.

Int[][] is a jagged array, unlike the int[][in C + +. It is actually a int[] that is embedded in the int[], which can be understood as (int[]) []. You can see the illustrations I attached.

Differences and pictures from: https://zhidao.baidu.com/question/84364211.html

C # Simple Array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.