Consider:
void foo1(char **p) { *p++; }
void foo2(char **p) { *p += 1; }
and
char *s = "abcd";
char *a = s;
foo1(&a);
printf("%s", a); //abcd
but if I use foo2()
instead of:
char *a = s;
foo2(&a);
printf("%s", a); //bcd
Can someone explain it?