How many consecutive nested pointer (pointer to pointer) can i have in one order? Is there a limit of doing references?

StackOverflow https://stackoverflow.com/questions/4960780

Question

The follow program declares a pointer then again a new pointer to hold address of previous pointer variable.. How much can I use nested pointer variable to hold memory address is there any limit?

#include <stdio.h>
#include <conio.h>

void main()
{
    int x=2,y=5;

    int *ptr;
    int **sptr;
    int ***ssptr;

    ptr = &x; // address of x
    *ptr = 0; 
    sptr = &ptr;
    ssptr = & sptr;

printf(" address is ip = %u %u %u",ptr,sptr,ssptr);
    _getch();
}

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top