Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?
Answer: D
Correct answer: float ****fun(float***);
Read the declaration outward from the name. The parameter is a pointer to a pointer to a pointer to a float, so it is written float ***. The return type is one level deeper again, so it is float ****.
Count the asterisks against the words: three for the parameter, four for the return. The other options mismatch one or both. Where such declarations become unreadable, a typedef for the intermediate types is the usual remedy.
Please log in or register to report this question.