2

Is it possible to create statically in C a 2d array of pointers to 2d arrays, like:

#define m 4
#define n 4
#define p 2
#define q 2

char arr1[m][n] = {{0}};
char arr2[m][n] = {{0}};
char (*parr[m][n])[p][q] = {{&arr1, 0, &arr2, 0}};

int main() {
    return 0;
}

The 2d array of pointers parr is sparse, with some values to 0 (NULL), which is why I don’t want to use a 4d array in the first place.

This compiles, but I get the following warning:

warning: initialization from incompatible pointer type

With the following command:

gcc -Wall -Wextra -pedantic -std=c99 test.c

What is wrong?