What does the declaration int (*f)(int); declare?
-
A
A pointer to a function taking an int
Correct answer
-
B
A function that returns an int pointer
-
C
An array of pointers to functions
-
D
A pointer to an array of int values
Correct answer
A. A pointer to a function taking an int
12 views
Explanation
The parentheses bind the asterisk to f, so it is a pointer to a function taking an int and returning an int.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ