But *ptr stores the actual value of the varible x right? Then why is it written *ptr=&x when it does not store its address. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

But *ptr stores the actual value of the varible x right? Then why is it written *ptr=&x when it does not store its address.

23rd Oct 2019, 4:34 PM
shreya
shreya - avatar
3 Answers
+ 1
Its address will be stored in ptr only right?
23rd Oct 2019, 4:35 PM
shreya
shreya - avatar
+ 1
*ptr is a pointer that stores the memory location of a variable. It does not store the actual value but the address where actual value is placed...
23rd Oct 2019, 4:46 PM
Abhishek Kumar Singh
Abhishek Kumar Singh - avatar
+ 1
Thankyou so much:)
23rd Oct 2019, 5:32 PM
shreya
shreya - avatar