I'm trying to wrap my head around pointers but it's confusing at the moment.
When a C compiler comes across a variable in memory it naturally reads the value present. If "X" was equal to 8 then the value of X would be read out as 8.
But when a compiler comes across a pointer in memory, it doesn't read the value of the pointer (the value of the pointer is random) but it instead goes to the address stored in the pointer.
But the thing is, every variable has a value and an address. Why does C specifically go the address of a pointer variable?
I'm not sure how to word this in a way that makes sense.
What is the point of declaring a pointer variable, when we can access the address of any variable using the & operator and print the pointer?
I'm having trouble visualising a pointer variable.
The way I see it now in my head is, every variable has an address and a value. This is a fact. I'm not sure what a pointer variable does since, like a normal variable, it also has a value and an address.