I just saw a function with the following signature:
bool insert( Node** root, int (*M)[COL], int row, int col )
What does COL do in this case?
I just saw a function with the following signature:
bool insert( Node** root, int (*M)[COL], int row, int col )
What does COL do in this case?
That's the array size. COL would have been #defined somewhere in code... Suppose COL is defined as 5, you are expected to provide a pointer to an array of 5 integers. Any other dimension would cause a compiler error.
For example.
#define COL 5
...
..
..
bool insert( Node** root, int (*M)[COL], int row, int col ) {
..
return 1;
}
...
And usage (in this case):
int test[5] = {0};
...
insert(&node, &test, 0, 0);
Will Compile and :
int test[10] = {0};
...
insert(&node, &test, 0, 0);
Will NOT compile...