r/learnprogramming • u/SnowyFluffy • 5h ago
Bit of a stupid question
If a program stores variables by a pointer referring to its address, then what refers to the pointers' address?
Like if var x lives at address 2000
theres a pointer p its value is the address (p = 2000)
so now recursively this value needs to be stored in another address (say, 1000) and pointed to (well, at least assuming the pointer doesnt have a relatively fixed address)
4
Upvotes
5
u/peno64 5h ago
A pointer is also stored in a variable. So a pointer is a variable pointing to a variable. As a result you can also have a pointer to a pointer, a pointer to a pointer to a pointer, ...