De-Referencing Pointer in C Programming Language :
- Asterisk(*) indirection operator is used along with pointer variable
- Asterisk Operator is also called as value at operator
- When used with Pointer variable, it refers to variable being pointed to,this is called as De-referencing of Pointers
Pointer De-referencing :
- Operation performed to access or manipulate data contained in memory location pointed to by a pointer
- Any Operation performed on the de-referenced pointer directly affects the value of variable it pointes to.
Live Example :
// Sample Code for De-referencing of Pointer int n = 50 , x ; int *ptr ; // Un-initialized Pointer ptr = &n; // Stores address of n in ptr x = *ptr; // Put Value at ptr in x
Evaluation :
// Sample Code for De-referencing of Pointer *(ptr) = value at (ptr) = value at (2001) = 50 //Address in ptr is nothing but address of n
Summary :
- Name of Normal Variable always points to the Value of variable
- Pointer variable always Stores Address of variable
- *ptr and n will give us same value.
| Variable | Value in it |
| n | 50 |
| &n | 1002 |
| ptr | 1002 |
| *ptr | 50 |

