C Quiz – 108 | Question 4
Both of the following declarations for function pointers are equivalent. Second one (i.e. with typedef) looks cleaner.
int (*funPtr1)( int ), (*funPtr2)( int );
typedef int (*funPtr)( int );
funPtr funPtr1, funPtr2;
|
(A) TRUE
(B) FALSE
Answer: (A)
Explanation: Usually data type of function pointers tends to be cryptic and that’s why it’s used in conjunction with typedef. Think of a function pointer which is pointing to a function that accepts a function pointer and that returns a function pointer. This can be used simplified using typedef otherwise it’s going to very difficult to read/understand!
Quiz of this Question
Last Updated :
28 Jun, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...