#include<stdlib.h>
int main()
{
char ch, *p1, **p2, ***p3, ****p4;
ch='a';
p1=&ch;
printf("%c %d %c\n", ch, p1, *p1);
p2=&p1;
printf("%d %d %c\n", p2, *p2, **p2);
p3=&p2;
printf("%d %d %d %c\n", p3, *p3, **p3, ***p3);
p4=&p3;
printf("%d %d %d %d %c\n", p4, *p4, **p4, ***p4, ****p4);
}
The output looks like :
a 298923415 a
298923416 298923415 a
298923424 298923416 298923415 a
298923432 298923424 298923416 298923415 a
Why is it that for p1 and p2 the address assigned is in increment of 1 and for p3 and p4 the address assigned is in increment of 8?
Do the addressing follow any pattern as they are assigned in continuous memory location?