+ 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.
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.
0
a pointer is the place where the address of your data (in other words where your memory is located) is stored
0
thank you for the answer