Introduction
The indirection operator is often denoted as “*”. It is crucial for working with pointers. indirection operator is a unary operator that allows you to access the value stored at the memory location held by a pointer variable. This concept is fundamental for tasks like dynamic memory allocation and passing parameters by reference.

This blog will try to understand the indirection operator in the C language. First, we understand the Operators in c. Then we go through the indirection operator in c language.
What is an Indirection Operator?
Dereferencing operator is commonly referred to as the indirection operator in c in computer programming. It serves as a pointer's representation. An asterisk (*) indicates that this dereferencing operator is present. There is saved the address of the variable that a pointer variable points to. A dereferencing operator returns the value of the variable it is referring to when it is utilized.

Example
In the language C, we can declare two variables, x, which store integer values, and p, which store pointers to integer values stored in memory:
int x; int *p;
In this case, the compiler is informed by the asterisk that "p is not an integer, but rather a reference to a place in memory that stores an integer" (int x; int *p). Here, it is a component of a pointer declaration rather than a dereference.
Now, we can use the & operator, which stands for "address of," to assign p to the place designated for the value of x.
p = &x;
This step informs the compiler that the address you allocated for the integer x is the address that p refers to in memory.
As an illustration, if we use the conventional method to set the value of x to 1, the outcome will be 1. and print the value.
x = 1; printf("%d", x);
By referring to p, we may also alter the value of x. This is indicated by an asterisk:
*p = 2; printf("%d", x);
The output then becomes 2.
Try it by yourself with a free online editor.
Implementation
/* Dereferencing Operators are explained in a C programme */
#include <stdio.h>
// Driver code
int main() {
//assigning variable t as 5.
int t=5;
int *ptr;
ptr=&t;
*ptr=7;
printf("Value of the variable is %d", t);
return 0;
}
Output
Value of the variable is 7
Explanation
Let's examine the software in question line by line:
- The variable that will be pointed at and the pointer is initially defined. ((int t=5, int *ptr);))
- The pointer variable (ptr=&t;) is then used to hold the variable's address.
- The dereferenced pointer (*ptr=7;) can change the variable's value.
Also see, Tribonacci Series and Short int in C Programming