C Programming - Pointers - Discussion

Discussion Forum : Pointers - Point Out Correct Statements (Q.No. 1)
1.
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?
float **fun(float***);
float *fun(float**);
float fun(float***);
float ****fun(float***);
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
18 comments Page 2 of 2.

Abid Khan said:   10 years ago
Simple trick to learn:

No. of Pointer (words) use in Q = no. of '*' take.

Yash said:   9 years ago
I can't understand pointers, please explain it.

Karthik said:   8 years ago
Thanks @Sundar.

Deepthi said:   7 years ago
I can't understand this, please anyone explain it properly.

Shreya said:   7 years ago
Thanks @Deepthi.

Pratiksha said:   6 years ago
Thanks all for explaining it.

Rajat said:   4 years ago
@Sundar.

Your explanation is very clear. I got it now. Thank you very much.

Dinesh said:   2 years ago
float****: This part specifies the return type of the function, which is a pointer to a pointer to a pointer to a pointer to a float. This is what you want to return from the function.

Fun: This is the name of the function.

(float***): This part specifies the parameter of the function, which is a pointer to a pointer to a pointer to a float. This matches the requirement of receiving a pointer to a pointer to a pointer to a float.

So, the correct declaration float ****fun(float***); ensures that the function takes the correct type of argument and returns the desired type of result as specified in your question.


Post your comments here:

Your comments will be displayed after verification.