top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is indirection in C Language ?

+1 vote
358 views
What is indirection in C Language ?
posted Jul 22, 2014 by Maninder Bath

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

If p is a pointer, the value of p is the address of the object. *p means “apply the indirection operator to p”; its value is the value of the object that p points to.

Now lets see the formal definition -
1. An indirection operator in C is also called dereferencing or value at operator in C.
2. It is used to access or manipulate the data at a specific location i.e. any operation performed at the de-referenced pointer directly impact/changes the value at the particular location where the pointer is pointing.

Example

int n = 5 , x ;
int *ptr ; 
ptr = &n; // Stores address of n in ptr
x = *ptr; // Put Value at ptr in x
*ptt = 20; // changes the value of n
answer Jul 23, 2014 by Salil Agrawal
...