Q:

why does *ptr++ act like *(ptr++) and not (*ptr)++?

Possible Duplicate:
++ on a dereferenced pointer in C? 

Similarly, what would
*ptr += 1
*ptr % 8, and
*ptr / 8
be?
The differences seem confusing.
Is this, perhaps, compiler dependent?

A:

It has to do with operator precedence. The * operator has a lower precedence than ++ so it occurs last.
Here's a Wikipedia chart that lists all the operators: http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence
You can see in the chart that postfix ++ has a precedence of 2 while * dereference has a precedence of 3. (The numbers are slightly backwards, as lower numbers have higher precedence).

A:

Operator precedence. The ++ operator "binds more tightly" than the * operator. 
Here's the table, in order of precedence.
http://isthe.com/chongo/tech/comp/c/c-precedence.html
This is not compiler dependent. It will always behave this way.

