int main() {
int **matrix = {
{1, 3, 2, 4},
{3, 2, 4, 5},
{9, 3, 2, 1}
};
getchar();
}
int[][]?int ** is a pointer type not an array type. Pointers are not arrays. Use type int [3][4].
You cannot pass arrays to functions but you can pass a pointer to an array. A function declaration to pass a pointer to an array 4 of int would be:
void f(int arr[3][4]);
or
void f(int arr[][4]);
or
void f(int (*arr)[4]);
The three declarations are equivalent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With