Sorry if this may seem like a stupid question.
I had this code:
char array1[2];
char array2[2];
char array3[2];
char *array[] = {
array1,
array2,
array3,
}
Now I changed array1,array2,array3 to be a 2 dimensional array:
char array1[2][2];
char array2[2][2];
char array3[2][2];
And I get the following error:
error: cannot convert 'char (*)[2]' to 'char*' in initialization
How can I init array with 2 dimensional array?
I also tried the following which didn't work:
char *array[2][2] = {
array1,
array2,
array3,
}
char array[][2][2] = {
array1,
array2,
array3,
}
Thanks!