I'm just trying to understand the concept of pointers in C and stumbled upon this error. I got the error "lvalue required as increment operand" for the following code. Please help me understand what is wrong.
#include<stdio.h>
int main()
{
char *s[] = {"black", "white", "pink", "violet"};
++s;
printf("%s\n", *s);
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s", **p+1);
return 0;
}
source
share