Home > Article > Backend Development > What does "dereferencing" a pointer mean in C/C++?
Dereference is used to access or manipulate the data contained in the memory location pointed to by the pointer. * (asterisk) is used with pointer variables, when dereferencing a pointer variable, it refers to the variable being pointed to, so this is called dereferencing of the pointer.
int main() { int a = 7, b ; int *p; // Un-initialized Pointer p = &a; // Stores address of a in ptr b = *p; // Put Value at ptr in b }
Here, the address in p is basically the address of the variable.
The above is the detailed content of What does "dereferencing" a pointer mean in C/C++?. For more information, please follow other related articles on the PHP Chinese website!