Pointers to Pointer Architecture in C

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.

*  -represent variable address&- represents base address.

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;

}

 

15

 

  1. &i 2 500
  2. ptr 2 500
  3. i 2 10
  4. ptr 210
  5. &ptr 2 600
  6. pptr 2 600
  7. pptr 2500
  8. **pptr 2 10

600 2 500210

 

 

  1. &pptr 2 700
  2. ppptr 2 700
  3. *ppptr 2600
  4. ** ppptr 2 500
  5. *** ppptr2 10

 

*(700)

      ↓

 

*(600)

      ↓

 

*(500)

      ↓

10