M
Michael Birkmose
The following creates a function "test" that takes a parameter that is
a pointer to a multi dimensional array.
typedef int int_arr[][3];
void test(int_arr *foo) {
printf("%d\n", (*foo)[1][2]);
}
int main() {
int a[2][3]= {1,2,3,4,5,6};
test(&a);
}
However, how do I specify this, if I don't want to use the typedef?
E.g what I would LIKE to do is:
void test(int[][3] *foo) {...}
However this produces a parse error. Is there any way to avoid typedefing?
a pointer to a multi dimensional array.
typedef int int_arr[][3];
void test(int_arr *foo) {
printf("%d\n", (*foo)[1][2]);
}
int main() {
int a[2][3]= {1,2,3,4,5,6};
test(&a);
}
However, how do I specify this, if I don't want to use the typedef?
E.g what I would LIKE to do is:
void test(int[][3] *foo) {...}
However this produces a parse error. Is there any way to avoid typedefing?