C Programming - Pointers - Discussion

Discussion Forum : Pointers - Find Output of Program (Q.No. 6)
6.
What will be the output of the program ?
#include<stdio.h>

void fun(void *p);
int i;

int main()
{
    void *vptr;
    vptr = &i;
    fun(vptr);
    return 0;
}
void fun(void *p)
{
    int **q;
    q = (int**)&p;
    printf("%d\n", **q);
}
Error: cannot convert from void** to int**
Garbage value
0
No output
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
95 comments Page 10 of 10.

Kapil said:   1 decade ago
Shivam nice explanation.

HEMANTH said:   1 decade ago
THANKS PRIYA...........

Ravi said:   8 years ago
Thank you for all.

Chintan said:   8 years ago
Thank you @Shivam.

Adarsh said:   1 decade ago
Thanks to all


Post your comments here:

Your comments will be displayed after verification.