Finding the maxElement of Two-Dimensional Array

a11e99z black80 at bk.ru
Sun Jun 30 15:38:42 UTC 2019


On Sunday, 30 June 2019 at 15:22:42 UTC, Samir wrote:
> How come this works:
> int[4][2] ta = [[2, 1, 4, 3], [3, 10, 2, 5]];
> writeln(ta[1].maxElement); // get error on this line
>

try to take slice from static arrays
writeln(ta[1][].maxElement);
or use dynamic arrays (slices)
int[][] ta = [[2, 1, 4, 3], [3, 10, 2, 5]]; // or auto ta



More information about the Digitalmars-d-learn mailing list