0 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 1.4k views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply prashant jha 1 commented Jan 14, 2019 reply Follow flag 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 0 replyShare shiva0 commented Jan 14, 2019 reply Follow flag 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 0 replyShare Satbir commented Jan 14, 2019 reply Follow flag 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 0 replyShare prashant jha 1 commented Jan 14, 2019 reply Follow flag int *ptr = &a and ptr = &a will do the same job. *ptr= &a will not do the same job. 0 0 replyShare shiva0 commented Jan 14, 2019 reply Follow flag thank you...! 0 0 replyShare Please log in or register to add a comment.