Is there any difference in:
char *foo[size];
and
char (*foo)[size];
In this example, the compiler complains if I declare my pointer with the first method:
void alloc_unitary_matrix(size_t size, char (*matrix)[size]) {
matrix = malloc(size*size);
memset(matrix, 1, size*size);
}
void main() {
size_t size = 10;
char (*matrix)[size];
alloc_unitary_matrix(size,matrix);
}
What did I misunderstand?