char *s;
char buf [] = "This is a test";
s = strchr (buf, 't');
if (s != NULL)
printf ("found a 't' at %s\n", s);
printf("%c\n",*s);
printf("%c\n",*s++);
printf("%c\n",*s++);
printf("%c\n",*s++);
printf("%c\n",*s++);
This code outputs:
found a 't' at test
t
t
e
s
t
Program ended with exit code: 0
In my view, *s should be t
and *s++ should be e
. But why they have same value in this code ?