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?
Discussion:
18 comments Page 1 of 2.
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.
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.
Sundar said:
1 decade ago
From the given question,
"... receives a pointer to pointer to a pointer to a float... " = ***
"... returns a pointer to a pointer to a pointer to a pointer..." = ****
Therefore, float ****fun (float ***) is the correct answer.
"... receives a pointer to pointer to a pointer to a float... " = ***
"... returns a pointer to a pointer to a pointer to a pointer..." = ****
Therefore, float ****fun (float ***) is the correct answer.
(1)
Nitinkv49@gmail.com said:
1 decade ago
If you want to receive a pointer then you can us a symbol " * ";
and if you want to return a pointer then you can us a symbol " * ";.
So as per our question that is "receives a "pointer to pointer to a pointer to a float".
We can use "float***"and same for function.
and if you want to return a pointer then you can us a symbol " * ";.
So as per our question that is "receives a "pointer to pointer to a pointer to a float".
We can use "float***"and same for function.
Krishan Kumar Pandey said:
1 decade ago
Can anybody explain This concept again? is it necessary if you passing (int***) to function the function return type should be 'void/int/float ***fun()';
Himanshu Gautam said:
1 decade ago
There are four pointers points to function fun and the argument it receives have three pointers.
Mehul said:
1 decade ago
float ****fun(float***);
is this possible i mean return value can also be in pointing thing????
is this possible i mean return value can also be in pointing thing????
Mehul said:
1 decade ago
float ****fun(float***);
Is this possible i mean return value can also be in pointing thing ?
Is this possible i mean return value can also be in pointing thing ?
Rajat said:
4 years ago
@Sundar.
Your explanation is very clear. I got it now. Thank you very much.
Your explanation is very clear. I got it now. Thank you very much.
Abid Khan said:
10 years ago
Simple trick to learn:
No. of Pointer (words) use in Q = no. of '*' take.
No. of Pointer (words) use in Q = no. of '*' take.
Deepthi said:
7 years ago
I can't understand this, please anyone explain it properly.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers