https://ide.codingblocks.com/s/57528
can u please explain why the error is being thrown.
PLEASE help : can’t understand the type of error
Hi Sindhu, in line number 32, make it arr[10][10] instead of arr[m][n] because the compiler cannot convert ‘int ()[n]’ to 'int ()[10]’.
Also, in line numbers 21 and 24, it would be j-- instead of j++, otherwise the for loops would run infinitely.
You can refer to the corrected code here https://ide.codingblocks.com/s/57815.
Hi ,can u please elaborate what does this error ( the compiler cannot convert ‘int ()[n]’ to 'int ()[10]’.) means.
Hey, in main() you have declared int arr[m][n]; i.e. array having variable number of rows and columns and passed it to spiralPrint(), but in the spiralPrint() you are taking the array as int arr[10][10] which is having the fixed no. of rows and columns. So, it will give you error that this variable n can’t be converted to a constant value 10.