+ 1
using an array as function parameter
I tried to implement a function with the following prototype but I got an error during the compilation time. void print_tab(int tab[][]) after I replaced the 'int tab[][]' with 'int tab[][N]' the error has gone, (N is a constant defined using #define). can someone explain me why?
1 Odpowiedź
+ 2
The following links might be able to help you:
https://stackoverflow.com/questions/12813494/why-do-we-need-to-specify-the-column-size-when-passing-a-2d-array-as-a-parameter
https://www.dummies.com/programming/cpp/passing-multidimensional-arrays-in-c/
https://www.quora.com/Why-do-dimensions-beyond-the-first-in-a-multidimensional-array-in-C-have-to-be-specified-in-the-function-header-when-they-are-passed-a-parameter