H
happy
Hello all, Below is a code snippet in C
#include<stdio.h>
int main (void)
{
static char *s[ ] = {“black”, “white”, “yellow”, “violet”};
char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
**++p;
printf(“%s\n”,*--*++p + 3);
return 0;
}
I am getting some problem in understanding output of this problem.
Here initially, p contains
address of first element of ptr i.e. &(s+3), then due to ++p, p is &(s
+2).
Now I can't understand how the term *--*++p in printf is evaluated.
Please Help me understand.
Is there any good way to understand these type of nested pointers?
#include<stdio.h>
int main (void)
{
static char *s[ ] = {“black”, “white”, “yellow”, “violet”};
char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
**++p;
printf(“%s\n”,*--*++p + 3);
return 0;
}
I am getting some problem in understanding output of this problem.
Here initially, p contains
address of first element of ptr i.e. &(s+3), then due to ++p, p is &(s
+2).
Now I can't understand how the term *--*++p in printf is evaluated.
Please Help me understand.
Is there any good way to understand these type of nested pointers?