To solve this question, the user needs to be familiar with C/C++ syntax and the concept of pointers.
A. char ** (* p) [12][12] = array;
This option is valid. p
is a pointer to a 3D array of char
pointers. It is initialized to point to the first element of the array
using the assignment operator =
.
B. char ***** p = array;
This option is not valid. p
is a pointer to a pointer to a pointer to a pointer to a pointer to a char
, which is not compatible with the type of array
.
C. char * (* p) [12][12][12] = array;
This option is not valid. p
is a pointer to a 4D array of char
pointers, which is not compatible with the type of array
.
D. const char ** p [12][12][12] = array;
This option is not valid. p
is a 3D array of const char
pointers, which is not compatible with the type of array
.
Therefore, the only valid option is:
The Answer is: A