[ACCEPTED]-SetLength on multidimensional array-pascal
Accepted answer
var
arr: array of array of real;
...
SetLength(arr, 10, 20); // creates a 10 by 20 matrix
A bad, but equivalent, way of doing this 1 is to do
SetLength(arr, 10);
for i := low(arr) to high(arr) do
SetLength(arr[i], 20);
The latter approach allows "non-rectangular" arrays, however.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.