19 January 2020 09:01:38 AM arrays_test C version Examples of array use. You can create and manipulate multiple-dimension arrays as though they were vectors, as long as you're willing. to do the indexing yourself. The 1D array A[]: i A[i] 0 500 1 501 2 502 3 503 4 504 5 505 6 506 7 507 8 508 9 509 The 1D vector B[], allocated dynamically: i B[i] 0 500 1 501 2 502 3 503 4 504 5 505 6 506 7 507 8 508 9 509 The matrix C[][]: k i j C[i][j] 0 0 0 11 1 1 0 21 2 2 0 31 3 3 0 41 4 4 0 51 5 0 1 12 6 1 1 22 7 2 1 32 8 3 1 42 9 4 1 52 10 0 2 13 11 1 2 23 12 2 2 33 13 3 2 43 14 4 2 53 15 0 3 14 16 1 3 24 17 2 3 34 18 3 3 44 19 4 3 54 20 0 4 15 21 1 4 25 22 2 4 35 23 3 4 45 24 4 4 55 The matrix D, stored as a column-major vector: k i j D[i+j*5] 0 0 0 11 1 1 0 21 2 2 0 31 3 3 0 41 4 4 0 51 5 0 1 12 6 1 1 22 7 2 1 32 8 3 1 42 9 4 1 52 10 0 2 13 11 1 2 23 12 2 2 33 13 3 2 43 14 4 2 53 15 0 3 14 16 1 3 24 17 2 3 34 18 3 3 44 19 4 3 54 20 0 4 15 21 1 4 25 22 2 4 35 23 3 4 45 24 4 4 55 25 0 5 16 26 1 5 26 27 2 5 36 28 3 5 46 29 4 5 56 30 0 6 17 31 1 6 27 32 2 6 37 33 3 6 47 34 4 6 57 The matrix E, stored as a row-major vector: k i j E[i*7+j] 0 0 0 11 1 0 1 12 2 0 2 13 3 0 3 14 4 0 4 15 5 0 5 16 6 0 6 17 7 1 0 21 8 1 1 22 9 1 2 23 10 1 3 24 11 1 4 25 12 1 5 26 13 1 6 27 14 2 0 31 15 2 1 32 16 2 2 33 17 2 3 34 18 2 4 35 19 2 5 36 20 2 6 37 21 3 0 41 22 3 1 42 23 3 2 43 24 3 3 44 25 3 4 45 26 3 5 46 27 3 6 47 28 4 0 51 29 4 1 52 30 4 2 53 31 4 3 54 32 4 4 55 33 4 5 56 34 4 6 57 arrays_test: Normal end of execution. 19 January 2020 09:01:38 AM