Multiple choice technology programming languages

int (*p)(char *a)

  1. p is a function that accepts an argument which is a pointer to a character and returns a pointer to a 10 element integer array

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

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

  4. None of the above

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

The declaration int (p)(char *a) is read as: p is a pointer (declared with *p) to a function (the surrounding parentheses) that takes a char argument and returns an int. Option A incorrectly describes p as the function itself. Option C describes a function that returns int, not int*. The key is that the parentheses around *p force p to be interpreted as a pointer first, then binding to the function signature.