0 votes 0 votes is *ptr=&a is true in C i found this in can anyone explain what does *ptr = &i; in the above picture Programming in C programming output programming-in-c + – shiva0 asked Jan 14, 2019 shiva0 853 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply prashant jha 1 commented Jan 14, 2019 reply Follow Share Pointer points to the address of an object. int *ptr = &a; &a gives the address where a is stored and that address is stored by ptr. While using pointer , * is called de-referencing operator . *ptr will get you the data stored at address in ptr 0 votes 0 votes shiva0 commented Jan 14, 2019 reply Follow Share okay i understand what you say.. but i have a doubt is int *ptr=&a; and ptr=&a will does the same job i means these two are same or not ??? 0 votes 0 votes Satbir commented Jan 14, 2019 reply Follow Share 1st and 2nd line are different things. I think you are getting confused in it. ------------------------------------------------------------------------------------------------------------------------------------------------------------------ int *ptr =&i; // we are creating the pointer and initiailizing it to point to address of i. here *ptr means than ptr is pointer variable. it can also be written as int *ptr; ptr =&i; //pointer points to location where value of i is stored ---------------------------------------------------------------------------------------------------------------------------------------------------------------- *ptr =&i; // we are storing the address of i as a value in the address location pointed by pointer. here *ptr is denoting the value present in the location where pointer ptr is pointing. ---------------------------------------------------------------------------------------------------------------------------------------------------------------- *ptr = i; // value contained in the address location pointed by pointer becomes i. 0 votes 0 votes prashant jha 1 commented Jan 14, 2019 reply Follow Share int *ptr = &a and ptr = &a will do the same job. *ptr= &a will not do the same job. 0 votes 0 votes shiva0 commented Jan 14, 2019 reply Follow Share thank you...! 0 votes 0 votes Please log in or register to add a comment.