ProgrammingHardProduct-company MCQ pattern

What is f in the declaration int *(*f)(int); ?

  1. A. A function that takes an int and returns a pointer to a pointer to int
  2. B. A pointer to a function that takes an int and returns an int
  3. C. A pointer to a function that takes an int and returns a pointer to int
  4. D. An array of pointers to functions returning int

Correct answer: C. A pointer to a function that takes an int and returns a pointer to int

Start at the name and work outward: (*f) means f is a pointer; (int) after it means to a function taking int; int * at the left is the return type, a pointer to int.

More C Programming questions

Exams that ask this topic