Question 6
Back to Exercise
Which declares get as a function taking an int and returning a pointer to a function (void) returning int?
- A int (*get)(int)(void);
- B int (*get(int))(void); Correct
- C int *get(int)(void);
- D int get(int)(*)(void);
Correct Answer: Option B
get(int) is the function; * makes its result a pointer; the outer (void) and int describe the function pointed to. With typedef int (*fn)(void); it becomes fn get(int);.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!