18 ptr=&i;////...........*ptr=i; can be used no doubt
19 printf("ptr=%d\n",ptr);
20
21 return 0;
22 }
23
24 OUT/P
:ptr=149381128
ptr=149381128
ptr=-1078390852
value of ptr=0
ADDRESS OF POINTER IS GONE CHANGED IN CALLED FUNCTION....SO VALUE IS NOT ASSIGNED TO ORIGIONAL PTR.....SO IN MAIN AFTER CALLING PTR...WE ARE NOT ABLE TO GET VALUE FROM PTR
the ptr variable in main() and in fun() both are different.As per the properties of functions variables get destroy once function is over and changes are not retain. If you value of ptr=17 then in func return ptr catch it in ptr=func();