ProgrammingVery hardProduct-company MCQ pattern

Which declaration correctly declares p as an array of 10 pointers to functions taking no arguments and returning a pointer to int?

  1. A. int **p[10](void);
  2. B. int (*p[10])(void)*;
  3. C. int *(*p)(void)[10];
  4. D. int *(*p[10])(void);

Correct answer: D. int *(*p[10])(void);

Reading right-to-left/clockwise from p: p[10] is an array of 10; (*p[10]) means each element is a pointer; (*p[10])(void) means pointer to a function(void); the leading int * means that function returns int*.

More C Programming questions

Exams that ask this topic