Two-dimensional arrays

Source: Internet
Author: User

1.

Summary: (1), Ii[x][y]: where x indicates which row, Y indicates which column

(2), dynamic non-matrix two-dimensional array ==> or less (or not) as well ...

2. Test code:

procedureTform1.button3click (sender:tobject);varII3:Array[0..1,0..2] ofInteger;beginMemo1.Lines.Add ("'); MEMO1.LINES.ADD ('A two-dimensional array of static matrices:'); MEMO1.LINES.ADD (IntToStr (Integer (@ii3 [0,0]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii3 [0][1]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii3 [0][2]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii3 [1][0]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii3 [1][1]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii3 [1][2])));End;procedureTform1.button4click (sender:tobject);varII4:Array  of Array  ofInteger;beginMemo1.Lines.Add ("'); MEMO1.LINES.ADD ('two-dimensional array of dynamic matrices:'); SetLength (Ii4,2,3); MEMO1.LINES.ADD (IntToStr (Integer (@ii4 [0,0]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii4 [0][1]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii4 [0][2]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii4 [1][0]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii4 [1][1]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii4 [1][2])));End;procedureTform1.button5click (sender:tobject);varII5:Array  of Array  ofInteger;beginMemo1.Lines.Add ("'); MEMO1.LINES.ADD ('Dynamic Non-matrix two-dimensional arrays:'); SetLength (Ii5,2); SetLength (ii5[0],3); MEMO1.LINES.ADD (IntToStr (Integer (@ii5 [0,0]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii5 [0][1]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii5 [0][2]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii5 [1][0]))); MEMO1.LINES.ADD ("'); SetLength (ii5[1],4); MEMO1.LINES.ADD (IntToStr (Integer (@ii5 [1][0]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii5 [1][1]))); MEMO1.LINES.ADD (IntToStr (Integer (@ii5 [1][2])));End;

2.1. Output:

Static matrix two-dimensional array: 163569216356961635700163570416357081635712 dynamic matrix Two-dimensional array: 472850847285124728516472853247285364728540 dynamic non-matrix Two-dimensional arrays: 4728508472851247285160472857247285764728580

3.

Two-dimensional arrays

Related Article

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.