Which declaration represents a function that accepts a pointer to a pointer to int and returns an int?

Options

  • A. int *fun(int *)
  • B. int fun(int **)
  • C. int **fun(int)
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. int fun(int **)

Detailed Explanation

Correct Answer: Option B

Explanation:
int fun(int **) declares a function returning an integer. Its parameter int ** is a pointer to a pointer to int. A double pointer can be used to access or modify an integer pointer passed by the caller.