void fun(int *p)
{
printf("op1 = %u\n", p);
int q = 10;
p = &q;
printf("op2 = %u\n", p);
}
int main()
{
int r = 20;
int *p = &r;
fun(p);
printf("op3 = %u", p);
return 0;
}
i tried something diff and found that here in the op i got the value of op1 and op3 as same and op2 as diff i.e p is not local ..plzz tell how after returning from the fun the value of p is getting changed automatically from op2 to op1??