This section illustrates you the concept of Multiple Indirection.
C permits the pointer to point to another pointer. This creates many layers of pointer and therefore called as multiple indirection. A pointer to a pointer has declaration is similar to that of a normal pointer but have more asterisk sign before them. This indicates the depth of the pointer. You can see in the given example, we have declared an integer variable i initialized to 100. The statement int ** pt creates a pointer which points to pointer to a variable with int value. We have passed the value of i to pointer pt2 and to pass the value of pt2 to pt1, we have used the statement pt1 = &pt2; which shows the Multiple Indirection.
Here is the code:
MULTINDI.C
#include <stdio.h>
|
Output will be displayed as:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: C Multiple Indirection
Post your Comment