Cannot implicitly convert expression [[0, -1, 2], [4, 11, 2]] of type int[][] to const(int[2])[]

MoonlightSentinel moonlightsentinel at disroot.org
Fri Jan 31 12:43:44 UTC 2020


On Friday, 31 January 2020 at 12:37:43 UTC, Adnan wrote:
> What's causing this?

You mixed up the array lengths:

const int[3][2] matA = [[0, -1, 2], [4, 11, 2]];
const int[2][3] matB = [[3, -1], [1, 2], [6, 1]];

matA is an SA containing <2> elements of type int[3].
matB is an SA containing <3> elements of type int[2].



More information about the Digitalmars-d-learn mailing list