Compilation Error

My Code is showing following Error
Declaration of array as multidimensional array must have bounds for all dimensions except the first.

Please explain why is it so… As far as I know it is not compulsory to pass array size while defining the function

@S18LP0146,

  • Declaring an array needs to have compile time constant bounds, eg int arr[5][6][7];
  • While declaring a function, we need to specify compile time constants on all dimensions except first,
    eg int function(int arr[][6][7]).

This is because, as we know, array no matter of what dimension, is stored contiguously in memory, thus for jumping from say 1st row to 2nd row, we need to know how many cells we have to skip on the contiguous allocation.
Refer here for more.

ok got it… Thank you Sir

ok got it… Thank you Sir.