Which of the following statements is TRUE for the function prototype…

2017

Which of the following statements is TRUE for the function prototype declaration given below?

Int *(*P) (char *Q[]);

  1. A.

    P is a function that accepts an argument which is a character array and returns a pointer to an integer quantity.

  2. B.

    P is a function that accepts an argument which is a pointer to a character array and returns a pointer to an integer quantity.

  3. C.

    P is a pointer to a function that accepts an argument which is an array of character pointers, and returns a pointer to an integer quantity.

  4. D.

    P is a pointer to function that accepts an argument which is a character array and returns a pointer to an integer quantity.

Attempted by 263 students.

Show answer & explanation

Correct answer: C

The correct option is C. According to the clockwise/spiral rule in C, (*P) indicates P is a pointer. Moving outward, (char *Q[]) means it points to a function accepting an array of character pointers, and int * means it returns a pointer to an integer.

Explore the full course: Coal India Management Trainee