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

2020-01-31 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, January 31, 2020 5:43:44 AM MST MoonlightSentinel via Digitalmars-d-learn wrote: > 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,

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

2020-01-31 Thread MoonlightSentinel via Digitalmars-d-learn
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>

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

2020-01-31 Thread Adnan via Digitalmars-d-learn
share the D online editor link but `shorten` button doesn't do anything onlineapp.d(24): Error: cannot implicitly convert expression [[0, -1, 2], [4, 11, 2]] of type int[][] to const(int[2])[] onlineapp.d(25): Error: cannot implicitly convert expression [[3, -1], [1, 2], [6, 1]] of type int