Pointers to Pointer Architecture with examples
Pointer to pointer: It is a concept of holding an address of pointer variable in to another variable.
- Pointer to pointer relations can be applied up to 12 stages but generally there is no any limitation.
- When we are increasing the pointer to pointer relations, then performance will be decreased.
|
Syntax:
Pointer: Datatype *ptr;
p2p: Datatype ** ppt;
P2p2p: Datatype *** ppptr;
void main()
{
inti;
int * ptr;
int ** pptr;
int ***pptr;
ptr=&ptr;
pptr=&pptr;
i=10;
}
- &i
500
- ptr
500
- i
10
- ptr
10
- &ptr
600
- pptr
600
- pptr
500
- **pptr
10
600 500
10
- &pptr
700
- ppptr
700
- *ppptr
600
- ** ppptr
500
- *** ppptr
10
*(700)
↓
*(600)
↓
*(500)
↓
10