Differences between three-dimensional and two-dimensional arrays

Source: Internet
Author: User
I've got a vivid image.
To treat a number as an egg, a variable of type int is an egg, right.
Now create a one-dimensional array int[5]: This is the equivalent of putting a row of 5 eggs in front of you, there is no problem here.
Next to the two-dimensional array int[3][4]: First, the second dimension of the two-dimensional array [4] we can determine that a row is 4 eggs, which is the same as the one-dimensional array. So what was [3] before? That's a couple of rows! So int[3][4] is equivalent to put 3 rows of eggs in front of you, a row of 4 ~
And then to the three-dimensional array int[3][4][5]: The third dimension of [5] is a row of 5 eggs in the previous array, the second dimension of [4] is a total of 4 rows. What about this [3]? That is, if the 4 rows of 5 eggs per row as a group, that is, 4*5=20 an egg is a group, in front of you will be placed in 3 groups of eggs ~
I don't know, do you understand?

A one-dimensional array is like a straight line, array content is the length of the line, two-dimensional array is a plane, array content is an area, measurements array is a BODY ~ ~ ~

The array can be said to be a container with a number, and each number has its own memory address corresponding to the two-dimensional array of understanding is actually very simple, you can imagine the classroom student seat, three-dimensional array can imagine the appearance of imitation.


Http://zhidao.baidu.com/link?url=_NooxI0U3w6KtwjzQ3PpAqR03ilDbyoqx6pTz7R6UK7wjfFBWVA43FNMdKccl1w6O8IdYBaj3WkQQL0K4y57Eq

Differences between three-dimensional and two-dimensional arrays

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.