I just started to study C, and when doing one example about passing pointer to pointer as a function\'s parameter, I found a problem.
This is my sample code :
The order of precedence for the 3 operators involved in your question is the following :
post-increment ++ > dereference * > assignment +=
You can check this page for further details on the subject.
When parsing an expression, an operator which is listed on some row will be bound tighter (as if by parentheses) to its arguments than any operator that is listed on a row further below it. For example, the expression
*p++is parsed as*(p++), and not as(*p)++.
Long story short, in order to express this assignment *ptr+=1 using the post-increment operator you need to add parentheses to the dereference operator to give that operation precedence over ++ as in this (*ptr)++