Bhaiya can you plz explain how you passed the 2d array using syntax a[][1000] ?
Plz explain how to pass 2D array to function
Hi @diskordiciti369
there are various methods to pass 2d array as function parameters
this is one way
a[][1000]
so while passing the 2Darray it is compulsory to pass the last value of matrix
so since this matrix is 2*2 matrix
so the 2nd paramter ie no of columns needs to be compulsorily sent
u may not want to send no of rows
u could have sent a[ROWS][COLUMNS]
the no of columns needs to be same as that defined in the calling function
I am getting this error:
cannot convert βint ()[n]β to βint ()[100]β for argument β1β to βvoid spiral_print(int (*)[100], int, int)β spiral_print(a,m,n);
u cannot pass a[][n]
u need to pass
a[][100]
Got it. Thank you so much
1 Like