Multiple choice

char ** array [12][12][12]; Consider array, defined above. Which of the following definitions and initializations of p is valid?

  1. char ** (* p) [12][12] = array;

  2. char ***** p = array;

  3. char * (* p) [12][12][12] = array;

  4. const char ** p [12][12][12] = array;

  5. char (** p) [12][12] = array;

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The array is declared as char ** array[12][12][12], which is a 3D array of pointers to char . To point to this array, we need a pointer to the first element, which is char * (*)[12][12]. This matches option A. Options B and C have incorrect indirection levels. D adds const incorrectly. E has wrong pointer type.