Question 6
Back to Exercise
Which typedef defines Op as a pointer to a function taking two ints and returning an int?
- A typedef int *Op(int, int);
- B typedef int (*Op)(int, int); Correct
- C typedef (int *)Op(int, int);
- D typedef int Op*(int, int);
Correct Answer: Option B
The brackets bind * to the name: "Op is a pointer to a function (int, int) returning int". Without them, int *Op(int, int) would be a function returning 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!