C Programming - Pointers - Discussion

Discussion Forum : Pointers - Point Out Correct Statements (Q.No. 4)
4.
In the following program add a statement in the function fun() such that address of a gets stored in j?
#include<stdio.h>
int main()
{
    int *j;
    void fun(int**);
    fun(&j);
    return 0;
}
void fun(int **k)
{
    int a=10;
    /* Add a statement here */
}
**k=a;
k=&a;
*k=&a
&k=*a
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
19 comments Page 2 of 2.

Ketaki said:   7 years ago
I cannot understand. Please explain in detail.

Shruti said:   9 years ago
What is the difference between **k & *k?

Anoop Mehra said:   7 years ago
C option is correct but it should be *k=&a;.

Sakshi said:   6 years ago
Didn't get, can anyone explain, please.

Priya said:   5 years ago
Can anyone explain it, please?

Omar said:   5 years ago
This is dangling pointer.

Chinnasamy said:   1 decade ago
any one explain this....

Hosam said:   8 years ago
Why not the option A?

Heena said:   1 decade ago
Thanks pavan.


Post your comments here:

Your comments will be displayed after verification.