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[]);

Answer: 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.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…

  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 455 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: Iocl Engineers Officers Grade A Paper 2

Loading lesson…