You must first understand what post increment does.
The increment post increases the variable by one BUT , the expression (p ++) returns the original value of the variable that will be used in the rest of the expression.
char data[] = "AX12";
char* p;
p = data;
char* a = p++;
p = data;
char l = *(p++);
value to be used in the remaining expression. Thus it is the
original value that gets de-referenced by * so makeing l 'A'
Now due to operator precedence:
*p++ is equivalent to *(p++)
Finally, we have a complex:
p = data;
char m = (*p)++;
source
share