Suppose we have the following code, which takes x, stores the value 4 in it, then stores the address of x in a pointer variable:
int x = 4;
int *address_of_x = &x;
What is the purpose of the * in int *address_of_x?
I understand * to be used for dereferencing a pointer - it takes an address and tells you what's stored there. But if an address is being stored, then what are we dereferencing? Or are we not dereferencing anything at all? Why isn't it written as:
int address_of_x = &x;