why .... :(

guys ...

void test ( int ary[][3] ) ;

why I must determine the numbers of columns in this header of function test ???
when we pass an array the compiler needs to know the size of its elements, not how many elements it has.
A two-dimensional array can be thought of as a one-dimensional array of elements (which just happen to be arrays themselves).
Thus the compiler needs to know the size of one of the elements.
Each element is a row of values so the compiler needs to know the type of elements and how many values (the number of columns) are in each row.
Hi there,

For a more in detail explanation of what Mr. Vaghani explained, have a look at: http://cplusplus.com/faq/sequences/

All the best,
NwN
Topic archived. No new replies allowed.