Which statement about the parameter definition int (*compare)(int, int); is false?

a. It defines a parameter that is a pointer to a function that receives two integer arguments and returns a pointer to an integer as a result.

b. Parentheses are needed around *compare because * has a lower precedence than the parentheses enclosing the function parameters.

c. Without the parentheses it would have defined a function that receives two integers and returns a pointer to an integer.

d. The corresponding parameter in the function prototype would ordinarily be int (*)(int, int) ;

Answer :

Parentheses are needed around *compare because * has a lower precedence than the parentheses enclosing the function parameters statement about the parameter definition int (*compare)(int, int); is false.

b. Parentheses are needed around *compare because * has a lower precedence than the parentheses enclosing the function parameters.

Explanation:

The function above is declared as a pointer function i.e. a function declared as a pointer. It is declared as: void (*hi)(int, int). Here, it declares a pointer function hi which has two integer arguments. It can be initialized as:

1. void hi();

2. func_ptr = hi;

So the function above defines a parameter that is a pointer to a function that receives two int arguments and returns a pointer to an integer. Even without the parentheses, it would have defined a normal function with the same result as the above stated. However, the parentheses are required around compare not because that parentheses have higher precedence than. It is declared because it is used in the pointer function declaration.