+ 1

What is the difference between a pointer anf a memory location?

please help me with my question I'm unable to understand them both and compare them.

20th Oct 2018, 1:58 PM
Lalith Adithya
Lalith Adithya - avatar
3 ответов
+ 2
When you declare a variable, memory is allocated. A pointer "points" to a part of memory using address. px = &x; // px stores x address . So if the x changes. When you access you pointer by using *. The value stored in memory changes. (Off course because they reference the same part of memory) When x is deleted (Read about scope and local variables) You still can have access of x values. You just need to access the memory that your pointer references.
20th Oct 2018, 4:43 PM
Anya
Anya - avatar
0
a pointer is the place where the address of your data (in other words where your memory is located) is stored
20th Oct 2018, 4:17 PM
Jitendra
Jitendra - avatar
0
thank you for the answer
21st Oct 2018, 12:22 AM
Lalith Adithya
Lalith Adithya - avatar