Here is an example of a two-dimensional, rectangular slice of a C++ array, with the default stride of 1 omitted.
print arr(201:203, 101:105) |
This command prints a block of elements in a large array. Note that the command omits stride-expression, using the default stride value of 1.
As illustrated, the first two expressions (201:203) specify a slice in the first dimension of this two-dimensional array (the three-row column). The slice starts with row 201 and ends with 203. The second set of expressions, separated by a comma from the first, defines the slice for the second dimension. The slice begins with column 101 and ends with column 105.